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


Please Help Members By Posting Answers For Below Questions

Which driver is a pure java driver

993


What is the best style for code layout in c?

632


Why functions are used in c?

587


What are the rules for the identifier?

671


What is type qualifiers?

663






How do I send escape sequences to control a terminal or other device?

613


Write the syntax and purpose of a switch statement in C.

629


What is an lvalue?

636


How does placing some code lines between the comment symbol help in debugging the code?

548


Why is %d used in c?

567


shorting algorithmS

1803


I came across some code that puts a (void) cast before each call to printf. Why?

679


What is I ++ in c programming?

627


program to convert a integer to string in c language'

1986


What does char * * argv mean in c?

625