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 is type qualifiers?
What is function prototype?
What are the 5 types of inheritance in c ++?
What does != Mean in c?
In c language can we compile a program without main() function?
How to write c functions that modify head pointer of a linked list?
Explain is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?
how can i write a program that prints out a box such that whenever i press any key8(coordinate number) on the keyboard, the box moves.
What is a c token and types of c tokens?
How can I call a function with an argument list built up at run time?
What does double pointer mean in c?
What are different types of operators?
typedef struct{ char *; nodeptr next; } * nodeptr ; What does nodeptr stand for?
How do you convert strings to numbers in C?
code for quick sort?