From: Mr. B. C. P. <phu...@gm...> - 2009-03-27 16:05:20
|
You can write the code as follows: char question = 'y' // small y int number; while ( question == 'y' ) { cout << "Enter a number to be squared: "; cin >> number; cout << "Square of " << number << " is " << number * number << endl; cout << "Do you want to enter another number ? Type ( y/n): "; // n or any char will come out of while loop cin >> question; } |