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
Explain what will the preprocessor do for a program?
Describe explain how arrays can be passed to a user defined function
How can I run c program?
can any one please explain, how can i access hard disk(physical address)? it is possible by the use of far,near or huge pointer? if yes then please explain......
Tell me is null always defined as 0(zero)?
When reallocating memory if any other pointers point into the same piece of memory do you have to readjust these other pointers or do they get readjusted automatically?
Can variables be declared anywhere in c?
What is the use of getchar() function?
Explain zero based addressing.
Explain the use of keyword 'register' with respect to variables.
Why & is used in c?
Design a program which assigns values to the array temperature. The program should then display the array with appropriate column and row headings.
What is operator promotion?
Want to know how to write a C program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the total number of disk writes by MySQL.
What is the use of f in c?