which is the shortest method to write a program to print 3 numbers in increasing order using if-else.......
suppose we enter 4 5 6 and the output is 6 > 5 > 4 ;
which is the shortest method to write a program to print 3 numbers in increasing order using if-else.......
suppose we enter 4 5 6 and the output is 6 > 5 > 4 ;
That's nice homework - why not try it yourself first?
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
i tried so much but i can't . no need of full program but if u tell me some simple trick , use of operators , etc !!!!!!!!!!
Oh come on - surely you can write it for two numbers, even if the number of 'if' statements used isn't the minimum.
What happens if we give you a 1-line piece of magic, then your tutor asks you to explain it to the rest of the class?
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
but program takes 2 or 3 pages......and it takes 9 something conditions... can u execute all condition in 2 or 3 steps
There are only 6 possible outcomes - how can you possibly have 2 pages of code.
Consider
if ( a > b && a > c )
How many permutations of b and c are left to resolve?
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
Test Cases; input to check program works right.
1 2 3
3 2 1
1 3 2
2 1 3
2 3 1
3 1 2
2 2 2
2 2 3
2 2 1
1 2 2
3 2 2
0 0 0
Tim S.
yes 6 possibilities. it goes 2 pages coz of paper size
my tutor ask me to solve this but i thnk its the shortest way to solve it
Hey do u know name of a windows bug which used as a useful program in windows now a days
Last edited by ravikanyal11; 10-24-2011 at 09:02 AM.
and more if we took 2 or 3 no. equal like stahta01 statement !
I m newbie in c so any other way to solve it only with looping , switch case ,
Last edited by ravikanyal11; 10-24-2011 at 09:11 AM.