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


Please Help Members By Posting Answers For Below Questions

What are the characteristics of arrays in c?

622


Where is c used?

662


Tell us the use of fflush() function in c language?

650


formula to convert 2500mmh2o into m3/hr

509


What are predefined functions in c?

580






What is the use of in c?

587


Difference between strcpy() and memcpy() function?

690


What are the standard predefined macros?

647


What is difference between far and near pointers?

622


what is the difference between 123 and 0123 in c?

733


What oops means?

596


why wipro wase

1842


What is a double c?

601


what is the syallabus of computer science students in group- 1?

1852


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

677