πŸ“Š C++
Q. What is the output of this program?
Code:
#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;
    }
  • (A) Compilation Error
  • (B) Runtime Error
  • (C) Garbage value
  • (D) The message you entered
πŸ’¬ Discuss
βœ… Correct Answer: (D) The message you entered

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
203
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Uday Singh
Publisher
πŸ“ˆ
96%
Success Rate