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
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 |
Answer / anji
We can compare two
values using unary
operators also
Is This Answer Correct ? | 0 Yes | 0 No |
Add Two Numbers Without Using the Addition Operator
The % symbol has a special use in a printf statement. Explain how would you place this character as part of the output on the screen?
how to write a c program to print list of fruits in alpabetical order?
Write a program that takes a 5 digit number and calculates 2 power that number and prints it.
void main() {int i=2; printf("%d%d%d",i,++i,i++); getch(); }
what are the files which are automatically opened when a c file is executed?
what is the difference between const volatile int i & volatile const int j;
What are .h files and what should I put in them?
What are Storage Classes in C ?
32 Answers CTS, HP, IBM, Maharaja Whiteline, Tamil Nadu Open University TNOU, TATA, TCS, Wipro,
Are bit fields portable?
what is use#in c
Explain how can I manipulate strings of multibyte characters?