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
How can I recover the file name given an open stream or file descriptor?
In c language can we compile a program without main() function?
How can you increase the size of a statically allocated array?
Difference between macros and inline functions? Can a function be forced as inline?
Is it fine to write void main () or main () in c?
How can I read data from data files with particular formats?
How will you write a code for accessing the length of an array without assigning it to another variable?
can we implement multi-threads in c.
What are identifiers c?
code for find determinent of amatrix
What are the types of functions in c?
What is a structure and why it is used?
Why is it important to memset a variable, immediately after allocating memory to it ?
What are register variables in c?
What is your stream meaning?