Dilbar
Replies to this thread:
More by Dilbar
What people are reading
Subscribers
Please log in to subscribe to Dilbar's postings.
:: Subscribe
|
could anyone help with this problem please
[VIEWED 4392
TIMES]
|
SAVE! for ease of future access.
|
|
|
Dilbar
Please log in to subscribe to Dilbar's postings.
Posted on 06-28-10 7:20
PM
Reply
[Subscribe]
|
Login in to Rate this Post:
0
?
|
|
could anyone help with this problem please
You are given three integer numbers: a, b and c. Write a function:int median3(int a,int b,int c); which returns the second largest number x, among sequence (a,b,c). For example: - for median3(4, 2, 6) the correct answer is 4,
- for median3(1, 2, 2) the correct answer is 2.
|
|
|
|
ANS
Please log in to subscribe to ANS's postings.
Posted on 06-29-10 1:15
PM [Snapshot: 176]
Reply
[Subscribe]
|
Login in to Rate this Post:
1
?
Liked by
|
|
what about this? ;-) int median3(int a, int b, int c) {
int middle;
if(a < b && a > c || a > b && a < c){ middle = a;} else if(b < a && b > c || b > a && b < c){ middle = b;} else{middle = c;};
return middle;
}
|
|
Please Log in! to be able to reply! If you don't have a login, please register here.
YOU CAN ALSO
IN ORDER TO POST!
Within last 60 days
Recommended Popular Threads |
Controvertial Threads |
TPS To F-1 COS |
Nepal TPS has been Extended !!! |
Got my F1 reinstatement approved within 3 months(was out of F1 for almost 2 years) |
Nepal TPS decision |
Has anyone here successfully reinstated to F-1 status after a year-long gap following a drop from F-1? |
TPS to F1 Status. |
TPS of Nepal to be automatically extended for 6 months based on South Sudan decision |
Genuine Question.... Why so many folks still in TPS after 10 years. Is the statistics wrong? |
Any input on remote jobs(IT related or Sales or Marketing)? |
Don’t Just Read—Join the Conversation |
Supreme Court allows Trump to end TPS for Venezuelans |
Nepal Likely to Get 60-Day TPS Notice |
TPS Sakiyo Tara Case is in Court. |
नेपाल मा B. sc गरियो यहाँ फेरी ७० -८० क्रेडिट पढ्नु पर्ने भो |
EAD HELP NEEDED URGENTLY! |
Need Help of IT consultancies |
मुद्दा हाल्छन होला र ? |
NEPAL TPS IS GONE |
TPS cancel bho bhane k garne? |
Trump’s “Big Beautiful Bill” is straight-up xenophobic class warfare. Let’s call it what it is. |
|
|
NOTE: The opinions
here represent the opinions of the individual posters, and not of Sajha.com.
It is not possible for sajha.com to monitor all the postings, since sajha.com merely seeks to provide a cyber location for discussing ideas and concerns related to Nepal and the Nepalis. Please send an email to admin@sajha.com using a valid email address
if you want any posting to be considered for deletion. Your request will be
handled on a one to one basis. Sajha.com is a service please don't abuse it.
- Thanks.
|