Accept & display a string - C++ Program

Q. Write a C++ program to accept a string from the user and display it on the screen.

Answer:

#include<iostream>
using namespace std;
int main()
{
        char str[100];
        cout<<"\n Enter Your Name : ";
        cin>>str;
        cout<<"\n Hello "<<str<<"... \n Welcome to TutorialRide ";
        return 0;
}


Output:

accept display string