Test #3

Fri NOV 17, 2000

C++ How to Program, by H. M. Deitel and P. J. Deitel

Teacher: Dr. B.J. Shrestha

What does the following program print?

//**************************************************
//  Name:         John Doe/ Jane Doe
//  Professor:    Dr. B. J. Shrestha
//**************************************************
#include <iostream.h>

int main() 
{
	int y, x = 1, total = 0;
	while (x <= 10) {
		y = x * x;
		cout << y << endl;
		total += y;
		++x;
	}
	cout << "Total is " << total << endl;
	return 0;
}