Find the largest number from the given 2 numbers without using
any loops and the conditional operator.
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / anji
We can compare two
values using unary
operators also
| Is This Answer Correct ? | 0 Yes | 0 No |
How can I read a directory in a c program?
write a program in c language for the multiplication of two matrices using pointers?
What is the right type to use for boolean values in c?
Explain data types & how many data types supported by c?
progrem to generate the following series 1 12 123 1234 12345
What is difference between array and structure in c?
What are runtime error?
What is the difference between array and linked list in c?
write a c program to print "Welcome" without using semicolon in the whole program ??
What are the functions to open and close the file in c language?
. Consider the following program main() { int a[5]={1,3,6,7,0}; int *b; b=&a[2]; } The value of b[-1] is (A) 1 (B) 3 (C) -6 (D) none
what is the difference between static variable and register variable?