The following program is designed to input two numbers and output their sum. It asks the user if he/she would like to run the program. If the answer is Y or y , it prompts the user to enter two...


The following program is designed to input two numbers and output their sum. It asks the user if he/she would like to run the program. If the answer isY ory, it prompts the user to enter two numbers. After adding the numbers and displaying the results, it again asks the user if he/she would like to add more numbers. However, the program fails to do so. Correct the program so that it works properly.



#include



#include



using namespace std;



int main()



{



    char response;



    double num1;



    double num2;



    cout < "this="" program="" adds="" two="" numbers."=""><>



    cout < "would="" you="" like="" to="" run="" the="" program:="" (y/y)="">



    cin >> response;



    cout <>



    cout < fixed="">< showpoint=""><>



    while (response == 'Y' && response == 'y')



    {



        cout < "enter="" two="" numbers:="">



        cin >> num1 >> num2;



        cout <>



        cout < num1="">< "="" +="" "="">< num2="">< "=" << (num1 – num2)



 << endl;



        cout << " would="" you="" like="" to="" add="" again:="" (y/y)="">



        cin >> response;



        cout <>



    }



    return 0;



 }



Jun 05, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here