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

Why is c used in embedded systems?

1101


Is it possible to have a function as a parameter in another function?

1060


Explain what is the best way to comment out a section of code that contains comments?

1126


Can we access the array using a pointer in c language?

1031


What are operators in c?

1010


Explain what is the difference between the expression '++a' and 'a++'?

1202


what is the function of pragma directive in c?

1104


write a program to find out prime number using sieve case?

2072


What is the purpose of the following code? Is there any problem with the code? void send(int count, short *to, short *from) { /* count > 0 assumed */ register n = (count + 7) / 8; switch (count % 8) { case 0: do { *to = *from++; case 7: *to = *from++; case 6: *to = *from++; case 5: *to = *from++; case 4: *to = *from++; case 3: *to = *from++; case 2: *to = *from++; case 1: *to = *from++; } while (--n > 0); } }

2486


Function which gives a pointer to a binary trees const an integer value at each code, return function of all the nodes in binary tree.?

1058


Is void a keyword in c?

972


Explain bitwise shift operators?

1222


What is meant by int main ()?

1185


Why calloc is better than malloc?

1015


I need previous papers of CSC.......plz help out by posting them.......

2278