int main( ) //main body
{
int x=1; //declares x to be 1
while(x<100); //keeps the loop going while x is less than 100
printf("%d\n",x); //this should print x every loop
x = x + 1; //this should add 1 to x every loop
getchar(); //this makes sure that the program doesn't breeze by the user : the idea is that they can press any key to continue
return 0; //returns a value, indicating to the program that there was success
}

12-18-2011

Gigabitten

Wow. Thanks, FloridaJo. I was right - that was amazingly simple. I will remember that syntax forever, mostly because it caused me so much trouble not to.

12-18-2011

CommonTater

Quote:

Originally Posted by Gigabitten

There is no error at least that Pelles C can find. I am just learning how loops work, and I am trying to figure out how to print out 1 - 99 without a bijillion printfs. Here is the code.