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
Apart from dennis ritchie who the other person who contributed in design of c language.
Write a program to print “hello world” without using semicolon?
How can a string be converted to a number?
What is clrscr in c?
any limit on the number of functions that might be present in a C program a) max 35 functions b) max 50 functions c) no limit d) none of the above
What is the difference between near, far and huge pointers?
What is %s and %d in c?
#include show(int t,va_list ptr1) { int a,x,i; a=va_arg(ptr1,int) printf(" %d",a) } display(char) { int x; listptr; va_star(otr,s); n=va_arg(ptr,int); show(x,ptr); } main() { display("hello",4,12,13,14,44); }
This is a variation of the call_me function in the previous question:call_me (myvar)int *myvar;{ *myvar += 5; }The correct way to call this function from main() will be a) call_me(myvar) b) call_me(*myvar) c) call_me(&myvar) d) expanded memory
Explain what does the format %10.2 mean when included in a printf statement?
What is the use of linkage in c language?
How does struct work in c?
a direct address that identifies a location by means of its displacement from a base address or segment a) absolute address b) relative address c) relative mode d) absolute mode
What is bash c?
Do pointers need to be initialized?