thats quite alright. as i mentioned above, the real difficulty is finding a solution to the problem, and not the part of inputting that into the computer in some programming language. if you were writing a book, what would be more difficult (mentally, not wrist strain!): coming up with the storyline/plot and its characters, etc, or writing those thoughts you have come up with on a piece of paper?
just think of a list/array as a bunch of "things". in this case, those "things" are numbers, more precisely they are integers. think of a loop as something that goes through a bunch of things (i.e. a list/array) and does something. in your case, you want to go through the list and compare the numbers in the list. using "for" loops you can easily go through a list, and have a variable that points to which thing in the list you're currently working on (i.e., an "index" in that list). heres an example of printing 10 numbers:
Code:
int[] myList = {5, 8, 10, 11, 4};
int i; // this is our "counter", which is used to keep track of where we are while looping through the above list of 5 things/numbers/integers
for ( i = 0; i < 5; i++ )
{
printf ("number %d is: %d\n" , i, list[i] );
}
the output would be:
Code:
number 0 is: 5
number 1 is: 8
number 2 is: 10
number 3 is: 11
number 4 is: 4
but anyways, im sure you must have
some notes on looping to refer to.
the point is to come up with something on paper, disregarding the syntax of the "C" language, then translate that to C code. so try and work on the first part.