You have some extra braces there. It should look more like this :
int main(int argc, char *argv[])
{
int m,n,a,b,
int Min = 0; int Max = 0; printf("m=");
scanf("%d",&m);
printf("n=");
scanf("%d",&n);
printf("a=");
scanf("%d",&a);
printf("b=");
scanf("%d",&b);
if( ( m > n ) && ( n > 8 ) ) {
if(a>b)
Max=a;
else
Max=b;
}
else
{
if(a<b)
Min=a;
else
Min=b;
}
printf("Max=%d\n",Max);
printf("Min=%d\n",Min);
return 0;
}
Note that I added a few things. Remember that unless your first
if
condition is true
Max
will not be assigned a value. Similarly, if the condition is false then
Min
will not be assigned a value so I added initializers for those.