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
Get step-by-step solutions from verified subject matter experts
