Question: c++ The following program invokes p() two times. What is the printout from the last call of p(ch)? #include using namespace std; void p(char ch)

c++

The following program invokes p() two times. What is the printout from the last call of p(ch)?

#include

using namespace std;

void p(char ch)

{

static int n = 4;

while (n > 0)

{

cout << ch;

n--;

}

cout << endl;

}

int main()

{

char ch = 'a';

p(ch);

p(ch);

return 0;

}

-------------

1- aaa

2- a

3- aaaa

4- aa

5- a blank line

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!