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 / 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


Please Help Members By Posting Answers For Below Questions

HOW TO SOLVE A NUMERICAL OF LRU IN OS ??????

2658


show how link list can be used to repersent the following polynomial i) 5x+2

2222


What is the default value of local and global variables in c?

1000


Not all reserved words are written in lowercase. TRUE or FALSE?

1201


In C language what is a 'dangling pointer'?

1085


Is it better to use malloc() or calloc()?

1085


how many key words availabel in c a) 28 b) 31 c) 32

1031


Explain what header files do I need in order to define the standard library functions I use?

1132


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.

2028


What is a structure member in c?

970


Is register a keyword in c?

1004


What are the advantages of union?

1037


What was noalias and what ever happened to it?

1002


How can I prevent another program from modifying part of a file that I am modifying?

1023


What is const volatile variable in c?

1004