Program 1:

#include <iostream>
using namespace std;
using namespace std;

int main(void) {

	 int guess;

	 char correct_guess = 'N';

	 while (correct_guess == 'N') {

		cout << "Enter a number between 0 and 10 ";
		cin >> guess;

		if (guess == 5) {
			 cout << "You guessed the secret number\n";
			 correct_guess = 'Y';
		} else {
			cout << "Sorry you did not guess correctly. Try again\n";
		}

	 } // end while

	return 0;

}

Program 2:

#include <iostream>
using namespace std;

int main(void) {

	 int ctr = 1;

	 while (ctr < 10) {

		cout << "ctr = " << ctr << endl;
		ctr++;

	 } // end while

	return 0;

}

Program 3:

#include <iostream>
using namespace std;

int main(void) {

	 int guess;
	 char correct_guess = 'N';

     cout << "Enter a number between 0 and 10 ctrl-Z to exit ";
	 cin >> guess;

	 while ((correct_guess == 'N') && (cin)) {

		if (guess == 5) {
			cout << "You guessed the secret number\n";
			correct_guess = 'Y';
		} else {
			cout << "Sorry you did not guess correctly. Try again\n";
			cout << "Enter a number between 0 and 10 ctrl-Z to give up ";
			cin >> guess;
		}

	 } // end while

	return 0;

}