Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

Explain what will the preprocessor do for a program?

1113


Describe explain how arrays can be passed to a user defined function

1167


How can I run c program?

1234


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......

1972


Tell me is null always defined as 0(zero)?

1140


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?

1337


Can variables be declared anywhere in c?

1151


What is the use of getchar() function?

1186


Explain zero based addressing.

1099


Explain the use of keyword 'register' with respect to variables.

1103


Why & is used in c?

1253


Design a program which assigns values to the array temperature. The program should then display the array with appropriate column and row headings.

2368


What is operator promotion?

1132


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.

2099


What is the use of f in c?

1034