so i got this piece of code today having some slight errors with it can you guys tell me how its actually done as i want to know where i have gone wrong here is the code ..
Using a for loop to input and output array values
*/
#include <stdio.h>
int main(void)
{
/* Declare an array of integers */
int Grades[5];
int nCount;
/* Populate the array */
for(nCount = 0; nCount < 5; nCount++)
{
printf("\nPlease enter a value for array element %d : ",nCount);
scanf("%d",&Grades[nCount]);
}
printf("\n\n"); /* Just a couple of lines to add a gap */
/* Display the array */
for(nCount = 0; nCount < 5; nCount++) /* Note that reusing nCount */
{
printf("Array element %d has the value %d\n", nCount, Grades[nCount]);
}
I was to Extend the code such that it also counts all entered values in the range -10 to -120 inclusive.
The code should now record the maximum and minimum values within each of the three specified ranges.
not sure how to do that