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

How can I recover the file name given an open stream or file descriptor?

1082


In c language can we compile a program without main() function?

1138


How can you increase the size of a statically allocated array?

1081


Difference between macros and inline functions? Can a function be forced as inline?

1278


Is it fine to write void main () or main () in c?

1031


How can I read data from data files with particular formats?

1049


How will you write a code for accessing the length of an array without assigning it to another variable?

1057


can we implement multi-threads in c.

1134


What are identifiers c?

1092


code for find determinent of amatrix

1972


What are the types of functions in c?

990


What is a structure and why it is used?

1229


Why is it important to memset a variable, immediately after allocating memory to it ?

2078


What are register variables in c?

1016


What is your stream meaning?

1243