logo image

C++ program to scan name of user and say hello with name

Views: 118

Following program shows you how to scan name of user and say hello with name In this program we get name from user using std::cin method and prints hello with that name using std::cout

#include <iostream>
#include <string>

int main() {
	std::string name;
	std::cout << "Please enter a name:";
	std::cin >> name;
	std::cout << "Hello " << name;
}

Output:

Please enter a name: Tom
Hello Tom 
We are looking for Interns!
Send your resumes to
[email protected]