I'm coding in C on geany a program supposed to display 3 inputed int by descending order, the compilation is successfull but it displays me only the last number and two zero , my teacher told us to use function so... i don't know what's wrong in my code ps : sorry for the identation i prefer checking all of that before to fix this.
#include <stdio.h>
#include <stdlib.h>
int a1,b1;
int a,b,c;
int i,j,k;
int mv;
int maxvalue ( int a1, int b1){
if (a1 > b1){
return a1;
}
else {
return b1;
}
}
void order ( int a, int b ,int c){
int mv = maxvalue( a1, b1);
if (a - mv == 0){
i = a;
}
else if ( b - mv == 0){
i= b;
}
else {
i = c ;
}
printf("%d\n", i);
if (( a < i) && ( a-mv ==0)) {
j=a;
}
else if (( b< i)&&( b - mv ==0 )) {
j = b;
}
else{
j = c;
}
printf("%d\n",j);
if (( a < j) && ( a - mv == 0)){
k=a;
}
else if (( b < j) &&( b - mv ==0 )) {
k = b;
}
else{
k = c;
}
printf("%d", k);
}
int main(int argc, char **argv)
{
a = a1;
b = b1;
scanf("%d%d%d", &a,&b,&c);
order(a, b , c);
return 0;
}