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
Is null always defined as 0(zero)?
Explain what is meant by 'bit masking'?
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
How do I send escape sequences to control a terminal or other device?
Explain what is page thrashing?
When is a null pointer used?
Which is not valid in C a) class aClass{public:int x;}; b) /* A comment */ c) char x=12;
What the different types of arrays in c?
explain what are pointers?
In which layer of the network datastructure format change is done
write a program to convert a expression in polish notation(postfix) to inline(normal) something like make 723+* (2+3) x 7 (not sure) just check out its mainly printing expression in postfix form to infix.
main() { inta=10,b=20; a>=5?b=100:b=200; printf("%d ",b); }
what is recursion in C
Is it possible to have a function as a parameter in another function?
How can I dynamically allocate arrays?