write a c program for greatest of three numbers without
using if statment
Answer Posted / sathishmani
void main()
{
int a=10,b=20,c=30,d;
d=((a>b)&&(a>c))?1:2;
switch(d)
{
case 1:
printf("%d",a);
break;
case 2:
d=(b>c)?b:c;
printf("%d",d);
break;
}
}
Is This Answer Correct ? | 68 Yes | 21 No |
Post New Answer View All Answers
What are the output(s) for the following ? #include char *f() {char *s=malloc(8); strcpy(s,"goodbye")} main() { char *f(); printf("%c",*f()='A'); }
What is else if ladder?
the portion of a computer program within which the definition of the variable remains unchanged a) mode b) module c) scope d) none
What are the advantages and disadvantages of a heap?
What type is sizeof?
In c programming typeing to occupy the variables in memory space. if not useing the variable the memory space is wasted.ok, how to avoid the situation..? (the variable is used & notused)
Why #include is used in c language?
When a c file is executed there are many files that are automatically opened what are they files?
How can I direct output to the printer?
‘ C’ PROGRAME TO SHOW THE TYPE OF TRANGLE BY ACCEPTING IT’S LENGTH .
Give me the code of in-order recursive and non-recursive.
What are examples of structures?
Why can’t we compare structures?
Explain how do you print only part of a string?
What is a constant and types of constants in c?