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 are the disadvantages of c language?
Does sprintf put null character?
Can we assign integer value to char in c?
What is a far pointer in c?
How to explain the final year project as a fresher please answer with sample project
What is selection sort in c?
Is there a way to jump out of a function or functions?
Explain the ternary tree?
What is pointer and structure in c?
What is operator precedence?
What is a good data structure to use for storing lines of text?
Explain what is wrong with this program statement?
Is null always equal to 0(zero)?
In C programming, what command or code can be used to determine if a number of odd or even?
What is the general form of function in c?