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 a macro, and explain how do you use it?
What are the types of unary operators?
Where static variables are stored in memory in c?
List the different types of c tokens?
What are pointers? What are different types of pointers?
how should functions be apportioned among source files?
Can we replace the struct function in tree syntax with a union?
What are multibyte characters?
any "C" function by default returns an a) int value b) float value c) char value d) a & b
What are the different types of objects used in c?
Explain what is the benefit of using enum to declare a constant?
What does sizeof int return?
Can we add pointers together?
What is calloc in c?
What’s the special use of UNIONS?