Course Solutions Uncategorized (Solved) : Include Using Namespace Std Run Program Using Console Pauser Add Getch System Pause Input Q29919678 . . . .

(Solved) : Include Using Namespace Std Run Program Using Console Pauser Add Getch System Pause Input Q29919678 . . . .

 

#include <iostream>

using namespace std;

/* run this program using the console pauser or add your owngetch, system(“pause”) or input loop */

int main(int argc, char** argv)

{

int ch,i,a,b,result,guess,chances=0;

Menu:

result=0;

guess=0;

chances=0;

cout <<“n1. Perform a Modulus division of two numbers”<<endl;

cout << “2. Perform Multiplication of two numbers”<<endl;

cout << “3. Perform Subtraction of two numbers”<<endl;

cout << “4. Exit” <<endl;

cin>>ch;

switch(ch)

{

case 1: cout << “Enter value for a:”;

cin>>a;

cout << ” Enter value for b: “;

cin >> b;

result=a%b;

repeat:

cout << “What is the expected output:”;

cin >> guess;

if (guess==result)

{

cout << ” Congratulation!”;

goto Menu;

}

if (guess!=result&&chances!=2)

{

chances++;

goto repeat;

}

else if(chances==2)

{

cout << “The correct answer is:”<<result<<endl;

goto Menu;

}

break;

case 2: cout << “Enter value for a :”;

cin >>a;

cout << “Enter

OR

PayPal Gateway not configured

OR

PayPal Gateway not configured

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post