*sort 3 numbers from highest to lowest by functions*/
#include<stdio.h>
void read(int & v1,int & v2, int & v3) {
printf("enter first number\n");
scanf("%d",&v1);
printf("\n enter second number\n");
scanf("%d",v2);
printf("\n enter third number\n");
scanf("%d",v3);
}
void sort(int &v1, int &v2, int &v3) {
int aux;
if (v3>v2) {
aux=v2;
v2=v3;
v3=aux;
}
if (v2>v1) {
aux=v1;
v1=v2;
v2=aux;
}
if (v2<v3) {
v2=aux;
v3=v2;
v3=aux;
}
}
void print(int v1, int v2, int v3){
printf("numbers are sorted %d, %d, %d \n",v1,v2,v3);
}
int main() {
int number1,number2,number3;
char key;
key='y';
while (key!='n') {
read(number1,number2,number3);
sort(number1,number2,number3);
print(number1,number2,number3);
scanf("%c",&key);
}
}