Line executes

Consider the following program. What is its exact output? Show the values of the variables after each line executes, as in Example 6-14. (6, 7, 8)

#include                                   //Line 1

using namespace std;                                 //Line 2

void funOne(int& a);                                 //Line 3

int main()                                           //Line 4

                                                    //Line 5

    int num1, num2;                                  //Line 6

    num1 = 10;                                       //Line 7

    num2 = 20;                                       //Line 8

    cout

    funOne(num1);                                    //Line 10   

cout << ” line=””>

 In main after funOne: num1 = ” < num1=””>

    return 0;                                        //line 12

                                                     //line 13

void funone(int& a)                                  //line 14

                                                    //line 15  

 int x = 12;                                      //line 16  

 int z;                                           //line 17

    z = a + x;                                       //line 18

    cout

    x = x + 5;                                       //line 20

    cout

    a = a + 8;                                       //line 22

    cout

“,=”” num2=”

    return 0;                                        //Line 12

 }                                                    //Line 13

void funOne(int& a)                                  //Line 14

                                                    //Line 15  

 int x = 12;                                      //Line 16  

 int z;                                           //Line 17

    z = a + x;                                       //Line 18

    cout

    x = x + 5;                                       //Line 20

    cout

    a = a + 8;                                       //Line 22

    cout << ” line=”” 23:=”” in=”” funone:=”” a=” << a<< ” ,=”” x=” << x<< ” ,=”” and=”” z=””>

    return 0;                                        //line 12

                                                     //line 13

void funone(int& a)                                  //line 14

                                                    //line 15  

 int x = 12;                                      //line 16  

 int z;                                           //line 17

    z = a + x;                                       //line 18

    cout

    x = x + 5;                                       //line 20

    cout

    a = a + 8;                                       //line 22

    cout

>

WhatsApp
Hello! Need help with your assignments?

For faster services, inquiry about  new assignments submission or  follow ups on your assignments please text us/call us on +1 (251) 265-5102

🛡️ Worried About Plagiarism? Run a Free Turnitin Check Today!
Get peace of mind with a 100% AI-Free Report and expert editing assistance.

X