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

What is calloc in c?

0 Answers  


a c variable cannot start with a) an alphabet b) a number c) a special symbol d) both b and c above

0 Answers  


How can I convert a number to a string?

0 Answers  


Can a pointer be null?

0 Answers  


what is a function method?give example?

0 Answers  


Write a program to generate prime factors of a given integer?

9 Answers   Microsoft,


how to find anagram without using string functions using only loops in c programming

0 Answers  


program to find middle element of linklist?

1 Answers   Huawei,


WHAT IS PRE POSSESSORS?

6 Answers   TATA,


What is uint8 in c?

0 Answers  


What is main return c?

0 Answers  


without using arithmatic operator convert an intger variable x into x+1

3 Answers  


Categories