Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions