Find the largest number from the given 2 numbers without using
any loops and the conditional operator.
Answer Posted / surya
if(!(a/b)) // if a is less than b then division result will be zero.
02
{
03
cout << " b is greater than a";
04
}
05
else if (!(a-b)) // we know a is greater than or equal to b now. check whether they are equal.
06
{
07
cout << "a and b are equal";
08
}
09
else
10
cout << "a is greater than b";
| Is This Answer Correct ? | 9 Yes | 6 No |
Post New Answer View All Answers
What is difference between && and & in c?
Write an efficient algo and C code to shuffle a pack of cards.. this one was a feedback process until we came up with one with no extra storage.
Differentiate between functions getch() and getche().
What is the importance of c in your views?
What are the types of operators in c?
What is mean by Data Driven framework in QTP? Can any one answer me in details on this regard.
List the difference between a 'copy constructor' and a 'assignment operator' in C?
Explain the advantages of using macro in c language?
What is the auto keyword good for?
what is uses of .net
process by which one bit patten in to another by bit wise operation is? (a) masking, (b) pruning, (c) biting, (d) chopping,
What is the difference between null pointer and wild pointer?
What is advantage of pointer in c?
To print the pattern 1 2 3 4 5 10 17 18 19 6 15 24 25 20 7 14 23 22 21 8 13 12 11 10 9
What is a shell structure examples?