write a program that accepts 3 numbers from the user. dispaly
the values in a descending order.
Answer Posted / nitin garg
#include <stdio.h>
#include <conio.h>
#include <string.h>
int main()
{
int a,b,c;
printf("Enter Three Number
");
scanf("%d%d%d",&a,&b,&c);
if(a>b && a>c)
{
if(b>c)
printf("%d %d %d",c,b,a);
else
printf("%d %d %d",b,c,a);
}
if(b>a && b>c)
{
if(a>c)
printf("%d %d %d",c,a,b);
else
printf("%d %d %d",a,c,b);
}
if(c>a && c>b)
{
if(b>a)
printf("%d %d %d",a,b,c);
else
printf("%d %d %d",b,a,c);
}
getch();
}
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
find out largest elemant of diagonalmatrix
What is graph in c?
How to draw the flowchart for structure programs?
Can you write the algorithm for Queue?
What is calloc malloc realloc in c?
In a switch statement, what will happen if a break statement is omitted?
What is an expression?
How can I read a binary data file properly?
Tell us something about keyword 'auto'.
Explain what is a const pointer?
What are the c keywords?
largest Of three Number using without if condition?
What is structure padding and packing in c?
What is the use of header files?
Why is %d used in c?