Write a program to print counting from 1 to 10 using for loop

6/25/2013 07:01:00 pm Unknown 0 Comments

#include <stdio.h>
#include <conio.h>
int main()
{
int x;
// The loop goes while x < 10, and x increases by one every loop
for ( x = 0; x < 10; x++ ) {
/* Keep in mind that the loop condition checks
the conditional statement before it loops again.
consequently, when x equals 10 the loop breaks.
x is updated before the condition is checked. */
printf( "%d\n", x );
}
getch();
}