I need it so that when you enter q or Q that it ends the program.How do I do that? please add it to my code.Thanks!
#include <cstdlib>
#include <iostream>
#include <ctime>
#include <cmath>
#include <string>
#include <iomanip>
using namespace std;
int main ()
{
srand(time(NULL));
bool run = true;
while (true)
{
cout << "A addition" << endl;
cout << "S subtraction" << endl;
cout << "Q quit" << endl;
cout << "Please enter your choice: ";
char choice;
cin >> choice;
switch(choice)
case 'A':
case 'a':
{
int num1 = rand() % 100 + 1;
cout << "How much is " << num1;
you pop everything in a loop that has a variable set to true until when prompted pressing q changes that variable to false, then we use code tags next time we post code because not doing that is naughty