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.

Answers were Sorted based on User's Feedback



Find the largest number from the given 2 numbers without using any loops and the conditional opera..

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

Find the largest number from the given 2 numbers without using any loops and the conditional opera..

Answer / anji

We can compare two
values using unary
operators also

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Interview Questions

Explain how many levels deep can include files be nested?

0 Answers  


What is string concatenation in c?

0 Answers  


Explain two-dimensional array.

0 Answers  


Explain how are portions of a program disabled in demo versions?

0 Answers  


sum of two integers values only other then integer it should print invalid input.

1 Answers  


What is malloc return c?

0 Answers  


can i know the source code for reversing a linked list with out using a temporary variable?

6 Answers   Honeywell,


why programs in c are running with out #include<stdio.h>? some warnings are display in terminal but we execute the program we get answer why? eg: main() { printf("hello world "); }

0 Answers  


How does C++ help with the tradeoff of safety vs. usability?

1 Answers  


What is the difference between char a[] = "string"; and char *p = "string"; ?

14 Answers   Adobe, Honeywell, TCS,


will u give me old quesrion papers for aptitude for L & t info tech?

1 Answers   Hindustan, L&T,


what are the various memory handling mechanisms in C ?

4 Answers   HP,


Categories