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 does typeof return in c?
Explain what are global variables and explain how do you declare them?
Explain about the constants which help in debugging?
What would happen to X in this expression: X += 15; (assuming the value of X is 5)
Why is C language being considered a middle level language?
What are global variables and explain how do you declare them?
How to compare array with pointer in c?
how can f be used for both float and double arguments in printf? Are not they different types?
please give me a VIRTUSA sample palcement papers.... you will only send TECHNICAL SECTION..... that is help for me Advance Thanks........................
find the value of y y = 1.5x+3 for x<=2 y = 2x+5 for x>2
Is Exception handling possible in c language?
What is string function in c?
Hai,I have done with my bachelor of commerce and planing to ms,please suggest me how to convince vo for shifting from commerce to computers. Visa on 8 DEC 2014 Npu university
What is difference between static and global variable in c?
Can a function argument have default value?