How to write a C program to determine the smallest among
three nos using conditional operator?
Answer Posted / azad sab;e,chiplun
void main()
{
int n1,n2,n3,small;
clrscr();
printf("Enter three numbers");
scanf("%d%d%d",&n1,&n2,&n3);
small=n1<n2?(n1<n3?n1:n3):(n2<n3?n2:n3);
printf("smallest number is:%d",small);
printf("press any key to close");
}
getch();
}
| Is This Answer Correct ? | 24 Yes | 21 No |
Post New Answer View All Answers
HOW TO SOLVE A NUMERICAL OF LRU IN OS ??????
show how link list can be used to repersent the following polynomial i) 5x+2
What is the default value of local and global variables in c?
Not all reserved words are written in lowercase. TRUE or FALSE?
In C language what is a 'dangling pointer'?
Is it better to use malloc() or calloc()?
how many key words availabel in c a) 28 b) 31 c) 32
Explain what header files do I need in order to define the standard library functions I use?
Write a program to display all the prime nos from 1 to 1000000, your code should not take time more than a minute to display all the nos.
What is a structure member in c?
Is register a keyword in c?
What are the advantages of union?
What was noalias and what ever happened to it?
How can I prevent another program from modifying part of a file that I am modifying?
What is const volatile variable in c?