So I am trying to write a basic program that asks the user to input any number other than 5, and after 10 iterations of the user not entering the number 5, I want the program to print to screen. Here is my code so far:
#include <iostream>
#include <string>
using namespace std;
int main(){
int num;
cout << "Please enter a number other than 5." << endl;
cin >> num;
while (num != 5){
cout << "Please enter a number other than 5." << endl;
cin >> num;
}
return 0;
}
I just don't know how to tell the computer to stop the loop at 10 iterations and output to the screen.