Getting input from user
We already studied how to print values in console using cout. Now we going to study how to get input from user using cin where "c" refers to "character" and "in" means "input". Thus, cin means "character input". In the following code example, the user can input a number, which is stored in the variable num. Then we print its cube value.
CODE
#include <iostream>
using namespace std;
int main() {
    //creating a variable to store entered value
    int num;
    // Instructing user to enter number
    cout << "Enter Number : ";
    // Getting input from user, storing it in num variable
    cin >> num;
    // Printing cube value in console
    cout << pow(num, 3) << endl; //pow(num,3) is the short way of writing num power 3
}
(Click Here, For more exercises)