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 3067
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 200 days
Recommended Popular Threads |
Controvertial Threads |
शीर्षक जे पनि हुन सक्छ। |
NRN card pros and cons? |
TPS Re-registration case still pending .. |
What are your first memories of when Nepal Television Began? |
TPS Re-registration |
Anybody gotten the TPS EAD extension alert notice (i797) thing? online or via post? |
Democrats are so sure Trump will win |
Basnet or Basnyat ?? |
TPS EAD auto extended to June 2025 or just TPS? |
nrn citizenship |
Sajha has turned into MAGATs nest |
Nas and The Bokas: Coming to a Night Club near you |
whats wrong living with your parents ? |
ChatSansar.com Naya Nepal Chat |
डीभी परेन भने खुसि हुनु होस् ! अमेरिकामाधेरै का श्रीमती अर्कैसँग पोइला गएका छन् ! |
3 most corrupt politicians in the world |
अमेरिकामा बस्ने प्राय जस्तो नेपालीहरु सबै मध्यम बर्गीय अथवा माथि (higher than middle class) |
if you are in USA illegally and ask for asylum it is legal |
TPS advance parole Travel document i-131, Class of Admission ? |
Travelling to Nepal - TPS AP- PASSPORT |
|
Nas and The Bokas: Coming to a Night Club near you |
|
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.
|