Easier View

Very sorry, The posts are all mixed-up . View blog archieve to start learning =D

About Me

My name is Luke Chin. Here to teach you guys how to code C++

Thursday, April 12, 2007

The while Statement

// The while statement is used to repeat a sequence of statements as long as they are true


#include
using std::cout;
using std::cin;
using std::endl; // if you havent seen this before it justs ends the line

int main()
{
int A;
A=1 ; //just making the variable A which is a number to 1

while (A<=30) //while A lesser or equal to 30 (start)
{
cout << A << endl; // print A
A++; // A + 1
} // (end) the loop just prints A and adds 1 to it prints A again until 30

system("pause");
return 0;
}

No comments: