I need to have the user input up to 20 integer values. Then, I need to display the subscript of the largest value in the array as well as the largest value itself. I think I have the programming required for the array completed, but I'm not sure how to make the program sort through it.
Here's what I have so far:
Does this look sufficient enough to accomplish the array aspect? If so, then how do I go about sorting through the integers to find and display the largest value?Code:#include <stdio.h>
#include <string.h>
#define max_number 20
int main(void)
{
int numbers[max_numbers][20],
arr[20];
int i;
for(i=0;i<21;i++)
{printf("Enter a number: ");
scanf("%d",&arr);
}
}
Thank you.