Print a message telling a user to press the letterToQuit key numPresses times to quit. End with newline.
•Ex: If letterToQuit = 'q' and numPresses = 2, print:
#include <iostream>
using namespace std;
int main() {
char letterToQuit;
int numPresses;
cin >> letterToQuit;
cin >> numPresses;
/* Your solution goes here */
return 0;
}
#include <iostream>
using namespace std;
int main() {
char letterToQuit;
int numPresses;
cin >> letterToQuit;
cin >> numPresses;
/* Your solution goes here */
cout << "Press the " << letterToQuit << " key " << numPresses << " times to quit." << endl;
return 0;
}
Comments
Leave a comment