SHARE
SPREAD
HELP

The Tradition of Sharing

Help your friends and juniors by posting answers to the questions that you know. Also post questions that are not available.


To start with, Sr2Jr’s first step is to reduce the expenses related to education. To achieve this goal Sr2Jr organized the textbook’s question and answers. Sr2Jr is community based and need your support to fill the question and answers. The question and answers posted will be available free of cost to all.

 

#
Authors:
Walter Savitch ,julia Lobur
Chapter:
Functions For All Subtasks
Exercise:
Self-test Exercises
Question:1 | ISBN:9780321531346 | Edition: 7

Question

What is the output of the following program?

#include <iostream>

void friendly( );

void shy(int audience_count);

int main( )

{

using namespace std;

friendly( );

shy(6);

cout << "One more time:\n";

shy(2);

friendly( );

cout << "End of program.\n";

return 0;

}

void friendly( )

{

using namespace std;

cout << "Hello\n";

}

void shy(int audience_count)

{

using namespace std;

if (audience_count < 5)

return;

cout << "Goodbye\n";

}

TextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbook

Answer

The output of the program code:

Hello

Goodbye

One more time:

Hello

End of program.

0 0

Discussions

Post the discussion to improve the above solution.