I'm following a C tutorial with exercisess, and in one of them you have to make a program that when given 3 variables tells the user the biggest and smallest number... This is what I have, but I get a tonne of errors!
Errors I get include: parse error in line 7 and "return type of 'main' is not 'int' "Code:#include <stdio.h> void main() { int x,y,z; printf("Escribe tres numeros\n"); scanf("%d %d %d", &x, &y, &z); if x>y && x>z && y>z { printf("Big numer is %d Small number is d%\n", &x,&z); }else if x>y && x>z && y<z{ printf("Big numer is %d Small number is d%\n", &x,&y); }else if y>x && y>z && x>z{ printf("Big numer is %d Small number is d%\n", &y,&z); }else if y>x && y>z && x<z{ printf("Big numer is %d Small number is d%\n", &y,&x); }else if z>x && z>y && y>x{ printf("Big numer is %d Small number is d%\n", &z,&x); }else printf("Big numer is %d Small number is d%\n", &z,&y); } }
Thanks
ps I should stop using scanf...



LinkBack URL
About LinkBacks



I used to be an adventurer like you... then I took an arrow to the knee.