Skip to content

Instantly share code, notes, and snippets.

@annibuliful
Created November 17, 2017 03:54
Show Gist options
  • Save annibuliful/7d4fe8c84841d28880d173553348e70c to your computer and use it in GitHub Desktop.
Save annibuliful/7d4fe8c84841d28880d173553348e70c to your computer and use it in GitHub Desktop.
#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