None of your features should work. The first of them sets the current value sum to variable a , which is unified.
Then, when looking for the MAX value, you check if the current amount (presumably a ) is greater than b , and if you store the value of b in sum .
Then, if you want to call a function before defining it, you need to put a function prototype at the beginning of your file. Since you call min() and max() before defining them, you have compilation errors.
It should be like this:
#include<stdio.h> void max (int a, int b, int c); void min (int f, int g, int h); void main() { int a,b,c,sum; printf("Put your numbers throughly one by one:\n"); scanf("%d", &a); scanf("%d", &b); scanf("%d", &c); printf("You have putted %d, %d, %d\n\n", a, b, c); max (a,b,c); min (a,b,c); } void max (int a, int b, int c) { int sum; sum = a; if(sum<b) sum=b; if(sum<c) sum=c; printf("The max value is:%d\n\n\n",sum); } void min (int f, int g, int h) { int sum; sum=f; if(sum>g) sum=g; if(sum>h) sum=h; printf("The min value is:%d\n\n\n",sum); }
source share