Hello,
-I suggest you start with a smaller array, say 5.
-Assign each element of this array yourself.
-Try to find the minimum, use in each step to see what's going on and if what you're righting follows your thinking..
For example, finding the minimum would look like :
Code:
#include<stdio.h>
int main(int argc, char *argv[])
{
int mainArray[5] = {10, 24, 2, 121, 0};
int i, min = 0;
for(i = 0; i<=4; i++)
{
printf("mainArray[%d] = %d\n", i, mainArray[i]);
}
printf("\n");
i = 0;
min = mainArray[i];
for(i = 0; i<=4; i++)
{
if(min > mainArray[i]) min = mainArray[i];
printf("Minimum for i=%d :%d\n", i,min);
}
printf("\nYour final Minimum is %d\n", min);
return 0;
}
It's a good idea not to put all the "features" all in once. Put one, make it work, debug. Add the other, etc...
All my best