Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What is the difference between a function and a method in c?

1034


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

2006


In a switch statement, explain what will happen if a break statement is omitted?

997


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

3275


What are the similarities between c and c++?

1002


Why isnt there a numbered, multi-level break statement to break out

995


Should I learn c before c++?

1177


How can I use a preprocessorif expression to ?

998


Why is struct padding needed?

1031


What is the difference between c &c++?

1087


What is #ifdef ? What is its application?

1054


Tell me what are bitwise shift operators?

1091


Where define directive used?

1032


what is uses of .net

1684


Explain what does the function toupper() do?

1006