Compute

What is the output of the following program? (6, 7, 8)

#include

using namespace std;

void compute(int x, int& y, int& z);

int main()

    int one = 7;     int two = 5;     int three = 6;

    compute(one, two, three);    cout < one=””>< “,=”” “=””>< two=””>< “,=”” “=””>< three=””><>

    compute(two, one, three);    cout < one=””>< “,=”” “=””>< two=””>< “,=”” “=””>< three=””><>

    compute(three, two, one);    cout < one=””>< “,=”” “=””>< two=””>< “,=”” “=””>< three=””><>

    compute(two, three, one);    cout < one=””>< “,=”” “=””>< two=””>< “,=”” “=””>< three=””><>

    return 0;

void compute(int x, int& y, int& z)

    int w = x + y – z;

    y = w % 2;

    x = y + w;

    z = x * y;

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