1#include <iostream>
2int main(){
3 std::string firstname; //variable created as a string
4 std::cout << "What's your first name\n";
5 std::cin >> firstname;//asking for the users' first name
6 std:: cout << "Hello " << firstname
7}
8//Works for anyone, don't need any packages, just type this is in and run it.
1int x;
2cout << "hurry, give me a number!: "; // Type a number and press enter
3cin >> x; // Get user input from the keyboard
4cout << "you picked: " << x << " !" // Display the input value
5
6OR use:
7getline >> (cin, variable-name);
8instead of
9cin >> x;
10