Vidyalelo
C++ Programming · Q131

Functions and Procedures in C++

Programming · C++ Programming · question 131

Q131

What will be the output of the following C++ code? #include #include using namespace std; string askNumber(string prompt = "Please enter a number: "); int main() string number = askNumber(); cout << "Here is your number: " << number; return 0; string askNumber(string prompt) string number; cout << prompt; cin << number; return number;

A.
5
B.
6
C.
the number you entered
Answer
D.
compile time error

Answer: Option C

Solution

Answer: Option C
No explanation is given for this question Let's Discuss on Board