The following program asks the user to enter two numbers. What is the output of the program if the user enters 12 and 14? #include using namespace std; void func1(int &, int &); void func2(int &, int &, int &); void func3(int, int, int); int main() { int x = 0, y = 0, z = 0; cout << x << " " << y << " " << z << endl; func1(x, y); cout << x << " " << y << " " << z << endl; func2(x, y, z); cout << x << " " << y << " " << z << endl; func3(x, y, z); cout << x << " " << y <<" " << z << endl; return 0; } void func1(int &a, int &b) { cout << "Enter two numbers: "; cin >> a >> b; } void func2(int &a, int &b, int &c) { b++; c−−; a = b + c; } void func3(int a, int b, int c) { a = b − c; }

Programming Logic & Design Comprehensive
9th Edition
ISBN:9781337669405
Author:FARRELL
Publisher:FARRELL
Chapter8: Advanced Data Handling Concepts
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

The following program asks the user to enter two numbers. What is the output of the program if the user enters 12 and 14?

#include <iostream>

using namespace std;

void func1(int &, int &);
void func2(int &, int &, int &);

void func3(int, int, int);

int main()

{

int x = 0, y = 0, z = 0;

cout << x << " " << y << " " << z << endl;

func1(x, y);
cout << x << " " << y << " " << z << endl;

func2(x, y, z);

cout << x << " " << y << " " << z << endl;

func3(x, y, z);
cout << x << " " << y <<" " << z << endl;

return 0;

}

void func1(int &a, int &b)

{

cout << "Enter two numbers: ";

cin >> a >> b;

}

void func2(int &a, int &b, int &c)

{

b++;
c−−;
a = b + c;

}

void func3(int a, int b, int c)

{

a = b − c;

}

 

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Mathematical functions
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage