I have been working on this program and am getting nowhere fast. The program returns the maximum value as 0 each time. At this point I am lost and have probably done more damage than good.
The program should ask the user to enter 20 integers and return the largest number. I would greatly appreciate any help.
int Max_Num(int); /* Function prototype*/
printf("\nPlease enter 20 numbers.\n\n");
for (number = 0; number < 20; ++number)
printf("\nEnter the number for %d:", number +1);
max = Max_Num(num);
printf("\nThe max interger was %d", num [max]);
/* Function Header*/
int Max_Num(int num)
int max = 0;
for (temp = 0; temp <=20; ++temp)
if (max < num[temp])
max = num[temp];