Hi, I am trying to write a program that counts the even numbers from 1-100.I am trying to do this by only using "while" loops.Here is my code at the moment:
Code:#include<stdio.h> int main () { int counter=0; while (counter<=100 && counter % 2==0){ printf("%d\n",counter); counter=counter+1; } return 0;
When i compile it it just prints a 0 then a space!
any ideas?



LinkBack URL
About LinkBacks



