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
What are the characteristics of arrays in c?
Where is c used?
Tell us the use of fflush() function in c language?
formula to convert 2500mmh2o into m3/hr
What are predefined functions in c?
What is the use of in c?
Difference between strcpy() and memcpy() function?
What are the standard predefined macros?
What is difference between far and near pointers?
what is the difference between 123 and 0123 in c?
What oops means?
why wipro wase
What is a double c?
what is the syallabus of computer science students in group- 1?
A function can make the value of a variable available to another by a) declaring the variable as global variable b) Passing the variable as a parameter to the second function c) Either of the two methods in (A) and (B) d) binary stream