✍️ Get Writing Help
WhatsApp

Static

What is the output of the following program? (11)

#include

using namespace std;

void trackStaticVar(int& x);

int main()

    int temp = 1;

    for (int count = 1; count < 5;=””>

        trackStaticVar(temp);

    return 0;

void trackStaticVar(int& x)

    static int stVar = 1;

    int u = 3;

    if (x >= u)

        stVar = 2 * stVar;

    else

        stVar = 3 * stVar;

    x++;

    cout

“stvar=” << stVar << ” ,=”” u=” << u << ” ,=”” x=””>

}

>

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