All pastes #716198 Raw Edit

Someone

public text v1 · immutable
#716198 ·published 2007-09-26 16:43 UTC
rendered paste body
//  Odd Count                       //
//     A program to add the first   //
//     100 odd numbers together.    //
//      26/09/07                    //

#include <cstdio>
#include <cstdlib>
#include <iostream>

using namespace std;

int main(int argc, char* pArgs[]){
	int num = 1;
	int counter = 1;
	int overall = 1;

	while(counter <= 99){
		counter ++;
		cout << "Term: " << counter << "\n";

		num += 2;
		cout << "Number: " << num << "\n";

		overall += num;
		cout << "So far: " << overall << "\n";
	}

	cout << "Total is " << overall;
	
	system("PAUSE");
	return 0;
}