//Author: Justin C. Miller 
// the FOR STATEMENT

// the for statment is used for LOOPING
// looping means to do things over and over again

// the for statemnt helps you accomplish just that

int main()
{
	// THE FOR STATMENT HAS 4 PARTS
	// 1. declaration of variable
	// 2. condtion to go until it is false
	// 3. incrementation of the variable
	// 4. what to do until the condtion is false

	// it'll look something like this
	// for( 1 ; 2 ; 3)
	// { 
	//		4 ;
	// }

	// the following starts the variable off at 0
	// it then cout's variable until variable is not
	// less than four, each time it cout's variable
	// variable++ increments the value of variable by 1
	// (variable++ is the same as variable = variable + 1)
	for(int variable = 0 ; variable < 4 ; variable++)
		cout << variable << endl ;

	// to print all number 1 to 100
	for(int x = 1 ; x <= 100 ; x++)
		cout << x << endl ;
	// to do it backwards
	for(int y = 100 ; y >= 1 ; y--)
		cout << y << endl ;

	// to print just the even numbers
	for(int u = 2 ; u <= 100 ; u = u + 2)
		cout << u << endl ;
	// just the odds
	for(int h = 1 ; h < 100 ; h = h + 2)
		cout << h << endl ;

	// to print the word HELLO 5 times
	// instead of cout 5 times
	// use a for loop
	for(int i = 0 ; i < 5 ; i++)
		cout << "HELLO" << endl ;

	// for loops are used to print arrays
	int a[5] = {7, 10, 12, 3, 100} ;
	for(int k = 0 ; k < 5 ; k++)
		cout << a[k] << endl ;

	return 0 ;
}