Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <conio.h>
- //This program will read 3 numbers, and print from greatest to smallest
- void main (void){
- int a,b,c;
- clrscr();
- printf("\nGive me the first number: ");
- scanf("%d", &a);
- printf("\nGive me the second number: ");
- scanf("%d", &b);
- printf("\nGive me the third number: ");
- scanf("%d", &c);
- clrscr();
- if (a<b<c){
- printf("Greatest number: C= %d Middle Number: B= %d Smallest Number: A= %d",c,b,a);
- getch();
- }
- else{
- if (b<c<a){
- printf("Greatest number: A= %d Middle Number: C= %d Smallest Number: B= %d",a,c,b);
- getch();
- }
- else{
- if (c<a<b){
- printf("Biggest Number: B= %d Middle Number: A= %d Smallest Number: C= %d",b,a,c);
- getch();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment