Permalink
Cannot retrieve contributors at this time
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
19 lines (18 sloc)
539 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// IO Exercise. | |
#include <iostream> | |
#include <string> | |
int main() | |
{ | |
std::string firstName; | |
std::string lastName; | |
int age; | |
std::cout << "Please enter your first name(s): "; | |
getline(std::cin, firstName); | |
std::cout << "Please enter your surname: "; | |
getline(std::cin, lastName); | |
std::cout << "Please enter your age: "; | |
std::cin >> age; | |
std::cout << std::endl; | |
std::cout << "Welcome " << firstName << " " << lastName << std::endl; | |
std::cout << "You are " << age << " years old." << std::endl; | |
} |