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 is void c?

801


Explain the use of 'auto' keyword in c programming?

922


What is 1f in c?

2331


how could explain about job profile

1684


hi folks i m approching for h1 b interview on monday 8th of august at montreal and i m having little problem in my approval notice abt my bithdate my employer has made a mistake while applying it is 12th january and istead of that he had done 18 the of january do any body have any solution for that if yes how can i prove my visa officer abt my real birthdate it urgent please let me know guys thaks dipesh patel

1662


Is a house a shell structure?

938


When a c file is executed there are many files that are automatically opened what are they files?

852


How pointer is different from array?

863


Why are algorithms important in c program?

874


What are the __date__ and __time__ preprocessor commands?

815


Does c have class?

891


What is the difference between array and structure in c?

827


What is the right type to use for boolean values in c?

845


How many keywords (reserve words) are in c?

843


Write a program to check palindrome number in c programming?

810