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

Apart from dennis ritchie who the other person who contributed in design of c language.

801


Write a program to print “hello world” without using semicolon?

665


How can a string be converted to a number?

506


What is clrscr in c?

666


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

625






What is the difference between near, far and huge pointers?

624


What is %s and %d in c?

586


#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); }

762


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

720


Explain what does the format %10.2 mean when included in a printf statement?

769


What is the use of linkage in c language?

610


How does struct work in c?

602


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

643


What is bash c?

550


Do pointers need to be initialized?

556