Question
1.
#include
2.
#include
3.
using namespace std;
4.
string askNumber(string prompt = "Please enter a number: ");
5.
int main()
6.
{
7.
string number = askNumber();
8.
cout
What is the output of this program?
1.
#include
2.
#include
3.
using namespace std;
4.
string askNumber(string prompt = "Please enter a number: ");
5.
int main()
6.
{
7.
string number = askNumber();
8.
cout
Answer: Option C
Was this answer helpful ?
In this program, we are getting a number and printing it.
Output:
$ g++ def1.cpp
$ a.out
Please enter a number:
5
Here is your number:5
Was this answer helpful ?
Submit Solution