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

What is a const pointer?

1035


What is meant by 'bit masking'?

1333


What are the advantages of the functions?

1096


What are the different types of objects used in c?

971


What are the 4 types of unions?

985


How can I find the modification date of a file?

1214


In C language, a variable name cannot contain?

1219


What are the advantages and disadvantages of a heap?

1146


Why is not a pointer null after calling free?

967


Explain is it valid to address one element beyond the end of an array?

1147


What should malloc(0) do? Return a null pointer or a pointer to 0 bytes?

1018


which of the following shows the correct hierarchy of arithmetic operations in C a) (), **, * or/,+ or - b) (),**,*,/,+,- c) (),**,/,*,+,- d) (),/ or *,- or +

1671


Can we compile a program without main() function?

1073


Explain what is #line used for?

1010


What are the types of assignment statements?

1005