Saturday, July 29, 2017

Write a C++ program to prompt the user to input her/his name and print the name on the screen.

/*
For more exercises and lessons, visit http://shegertech.blogspot.com/
*/

#include <cstdlib>
#include <iostream>

using namespace std;

int main()
{
    char name[20];
    cout<<"Enter your name:";
    cin>>name;
    cout<<"Hello "<<name<<"! \n";
     
    system("PAUSE");
    return EXIT_SUCCESS;
}

Share: