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
Why is c used in embedded systems?
Is it possible to have a function as a parameter in another function?
Explain what is the best way to comment out a section of code that contains comments?
Can we access the array using a pointer in c language?
What are operators in c?
Explain what is the difference between the expression '++a' and 'a++'?
what is the function of pragma directive in c?
write a program to find out prime number using sieve case?
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); } }
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.?
Is void a keyword in c?
Explain bitwise shift operators?
What is meant by int main ()?
Why calloc is better than malloc?
I need previous papers of CSC.......plz help out by posting them.......