Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

What is output of the following program? #include using namespace std; int func ( int &x , int y = 1 0 ) { if

What is output of the following program?
#include
using namespace std;
int func(int &x, int y =10)
{
if (x % y ==0)
return ++x;
else
return y--;
}
int main()
{
int p =20, q =23;
q = func(p, q);
cout p """" q endl;
p = func (q);
cout p """" q endl;
q = func (p);
cout p """" q endl;
return 0;
}
a.
2022
1023
1111
b.
2023
1023
1111
c.
2023
923
1111
d.
2023
1023
1011a.2022
1023
1111
b.2023
1023
1111
c.2023
923
1111
d.2023
1023
1011
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Processing

Authors: David Kroenke

11th Edition

0132302675, 9780132302678

Students also viewed these Databases questions

Question

1.4 Identify tools to help makeevidence-based HRM decisions.

Answered: 1 week ago