Thank you all for the responses.
I got the clarity i needed.
I do understand the policy of not giving the full answers as yes i agree it does not help when learning. I normal would not have asked only i was badly stuck and my real exam is on Friday.
anyway here is what i managed to make.
Code:
#include <stdio.h>
#include <conio.h>
#define NUM_ELEMENTS 10
void main(void)
{
int c = 0, /* loop counter */
pos_count = 0,
even_count = 0,
less_than_index_count = 0,
list[NUM_ELEMENTS];
do
{
printf("Enter in a number: ");
scanf("%d", &list[c]);
if (list[c] < c)
++less_than_index_count;
if (list[c] > 0)
++pos_count;
if (list[c] % 2 == 0)
++even_count;
} while (++c < NUM_ELEMENTS);
printf("Of the %d numbers:\n", NUM_ELEMENTS);
printf("%3d were less than their index\n", less_than_index_count);
printf("%3d were positive\n", pos_count);
printf("%3d were even\n", even_count);
printf("Program ended.\n");
fflush(stdin);
getchar();
return 0;
}
I had most of the above in my head at the time of asking the question i just could not get it to fit together at the time.
Only think is that i cant figure out is
getting it to print out the numbers entered by a user at the end.
So a user will put in 10 numbers and the program can tell them how many are even and how many are under the index value. but i would like to be able to get it to show the number too.
Is that possible in C only code?
This is all done under C intro code i start C advanced next month after the exams.
Thanks again for all your help on this.