Home » C++ Programming » Introduction » Question
  1. What is the output of this program?
    #include 
    #include
    using namespace std;
    string askMessage(string Message = "Please enter a message: ");
    int main()
    {
    string Input = askMessage();
    cout << "Here is your message: " << Input;
    return 0;
    }
    string askMessage(string Message)
    {
    string Input;
    cout << Message;
    cin >> Input;
    return Input;
    }
    1. Compilation Error
    2. Runtime Error
    3. Garbage value
    4. The message you entered
    5. None of these
Correct Option: D

In this program, we are getting a number and printing it.



Your comments will be displayed only after manual approval.