How to write a C program to determine the smallest among
three nos using conditional operator?
Answer Posted / sai
#include<stdio.h>
#include<conio.h>
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 ? | 32 Yes | 11 No |
Post New Answer View All Answers
What is the difference between a function and a method in c?
which of the following is not a character constant a) 'thank you' b) 'enter values of p, n ,r' c) '23.56E-o3' d) all of the above
In a switch statement, explain what will happen if a break statement is omitted?
please help me..... please codes and flowchart plz turbo c lang po yan.....please asap response... 3. Make an astrology program. The user types in his or her birthday (month, day, and year as integer), and the program responds with the user’s zodiac sign, horoscope, and other information related to it. If the user’s birth year falls into a leap year, your program should display an appropriate message for it. NOTES: Conditional Statements: it should be with graphics
What are the similarities between c and c++?
Why isnt there a numbered, multi-level break statement to break out
Should I learn c before c++?
How can I use a preprocessorif expression to ?
Why is struct padding needed?
What is the difference between c &c++?
What is #ifdef ? What is its application?
Tell me what are bitwise shift operators?
Where define directive used?
what is uses of .net
Explain what does the function toupper() do?