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 is a macro, and explain how do you use it?

1016


What are the types of unary operators?

1128


Where static variables are stored in memory in c?

948


List the different types of c tokens?

1010


What are pointers? What are different types of pointers?

1058


how should functions be apportioned among source files?

1058


Can we replace the struct function in tree syntax with a union?

1238


What are multibyte characters?

1061


any "C" function by default returns an a) int value b) float value c) char value d) a & b

1042


What are the different types of objects used in c?

972


Explain what is the benefit of using enum to declare a constant?

1020


What does sizeof int return?

1025


Can we add pointers together?

1000


What is calloc in c?

1080


What’s the special use of UNIONS?

1106