I've been working on a code to take the max and min of 11 user inputted numbers, but I can't get the code to work.
I was wondering if anyone here could help me troubleshoot the code
#include <stdio.h>
int max, min;
int a,b,c,d,e,f,g,h,i,j,k;
MAXMIN(int a, int b, int c, int d, int e, int f, int g, int h, int i, int j, int k, int min, int max)
{
min=(std::min a,b,c,d,e,f,g,h,i,j,k);
max=(std::max a,b,c,d,e,f,g,h,i,j,k);
}
main()
{
int a,b,c,d,e,f,g,h,i,j,k;
int min, max;
printf ("Enter an integer number.\n");
scanf("%d",&a);
printf ("Enter a second integer number.\n");
scanf("%d",&b);
printf ("Enter a third integer number.\n");
scanf("%d",&c);
printf ("Enter a fourth integer number.\n");
scanf("%d",&d);
printf ("Enter a fifth integer number.\n");
scanf("%d",&e);
printf ("Enter a sixth integer number.\n");
scanf("%d",&f);
printf ("Enter a seventh integer number.\n");
scanf("%d",&g);
printf ("Enter an eighth integer number.\n");
scanf("%d",&h);
printf ("Enter a ninth integer number.\n");
scanf("%d",&i);
printf ("Enter a tenth integer number.\n");
scanf("%d",&j);
printf ("Enter a eleventh integer number.\n");
scanf("%d",&k);
min=0;
max=0;
MAXMIN(a,b,c,d,e,f,g,h,i,j,k,&min,&max);
printf("The minimum of your inputted numbers is "%d"\n",&min);
printf("The maximum of your inputter numbers is "%d"\n",&max);
}
Thanks in advance.
I was wondering if anyone here could help me troubleshoot the code
#include <stdio.h>
int max, min;
int a,b,c,d,e,f,g,h,i,j,k;
MAXMIN(int a, int b, int c, int d, int e, int f, int g, int h, int i, int j, int k, int min, int max)
{
min=(std::min a,b,c,d,e,f,g,h,i,j,k);
max=(std::max a,b,c,d,e,f,g,h,i,j,k);
}
main()
{
int a,b,c,d,e,f,g,h,i,j,k;
int min, max;
printf ("Enter an integer number.\n");
scanf("%d",&a);
printf ("Enter a second integer number.\n");
scanf("%d",&b);
printf ("Enter a third integer number.\n");
scanf("%d",&c);
printf ("Enter a fourth integer number.\n");
scanf("%d",&d);
printf ("Enter a fifth integer number.\n");
scanf("%d",&e);
printf ("Enter a sixth integer number.\n");
scanf("%d",&f);
printf ("Enter a seventh integer number.\n");
scanf("%d",&g);
printf ("Enter an eighth integer number.\n");
scanf("%d",&h);
printf ("Enter a ninth integer number.\n");
scanf("%d",&i);
printf ("Enter a tenth integer number.\n");
scanf("%d",&j);
printf ("Enter a eleventh integer number.\n");
scanf("%d",&k);
min=0;
max=0;
MAXMIN(a,b,c,d,e,f,g,h,i,j,k,&min,&max);
printf("The minimum of your inputted numbers is "%d"\n",&min);
printf("The maximum of your inputter numbers is "%d"\n",&max);
}
Thanks in advance.