Created
November 17, 2017 03:54
-
-
Save annibuliful/7d4fe8c84841d28880d173553348e70c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
void swap(int *n , int *k){ | |
int temp; | |
temp = *n; | |
*n = *k; | |
*k = temp; | |
} | |
void order(int *x , int *y , int *z){ | |
if(*x>=*y && *x>=*z){ | |
swap(x,z); | |
if(*x > *y){ | |
swap(x,y); | |
} | |
}else if(*y>=*x && *y>=*z){ | |
swap(y,z); | |
if(*x > *y){ | |
swap(x,y); | |
} | |
}else{ | |
if(*x > *y){ | |
swap(x,y); | |
} | |
} | |
} | |
int main(){ | |
int x , y , z; | |
printf("Input (x , y , z): "); | |
scanf("%d %d %d" , &x , &y , &z); | |
order(&x , &y , &z); | |
printf(" lowest: %d \n medium: %d \n Highest: %d \n" , x , y ,z); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment