Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

What are the disadvantages of c language?

1200


Does sprintf put null character?

1053


Can we assign integer value to char in c?

1258


What is a far pointer in c?

1049


How to explain the final year project as a fresher please answer with sample project

977


What is selection sort in c?

1108


Is there a way to jump out of a function or functions?

1107


Explain the ternary tree?

1033


What is pointer and structure in c?

1193


What is operator precedence?

1218


What is a good data structure to use for storing lines of text?

1089


Explain what is wrong with this program statement?

1126


Is null always equal to 0(zero)?

1040


In C programming, what command or code can be used to determine if a number of odd or even?

1067


What is the general form of function in c?

1022