Sorry , Newbie here
i have no clue on how to do "Write a complete C program to read twenty (20) integer numbers. Then count and display the number of even and odd numbers among the twenty (20) integers read. Use a while loop to perform the repetition task."
is there any example ?
please help~:(
I only know do in For loop
#include <stdio.h>
#include <stdlib.h>
main()
{
int n=0;
int i=0;
printf("This is even\n");
for(i=1;i<=20;i++)
{
if(i%2==0)
printf("%d\n",i);
}
printf("This is odd\n");
for(n=0;n<=20;n++)
{
if(n%2==1)
printf("%d\n",n);
}
system("PAUSE");
return 0;
}
any example for doing in while loop ?