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
How to create struct variables?
In the DOS enveronment, normal RAM that resides beyond the 1mb mark. a) expanded memory b) swapped memory c) Extended memory d) none
write a c program in such a way that if we enter the today date the output should be next day's date.
What would be an example of a structure analogous to structure c?
What are directives in c?
How can I manipulate individual bits?
define string ?
Can you explain the four storage classes in C?
What is operator promotion?
What does %2f mean in c?
2) Write a program that will help Air Traffic Control for an airport to view the sequence of flights ready for take-off. The airport can accommodate 10 flights waiting for take-off at any point in time. Each flight has a unique 3 digit numeric identifier. Each time a flight takes-off, Air Traffic Control adds a flight to the waitlist. Each time a flight is added to the waitlist, the list of flights waiting to take-off must be displayed. When a flight is cleared for take-off, Air Traffic Control removes the flight from the waitlist. Each time a flight takes-off, the list of flights waiting to take-off must be displayed. Sequence of take-off is the sequence of addition to the waitlist
Explain what is #line used for?
Differentiate call by value and call by reference?
Why double pointer is used in c?
What are the data types present in c?