Check out example codes for "taking input from user c++". It will help you in understanding the concepts better.

Code Example 1

int x; 
cout << "hurry, give me a number!: "; // Type a number and press enter
cin >> x; // Get user input from the keyboard
cout << "you picked: " << x << " !" // Display the input value

OR use:
getline >> (cin, variable-name);
instead of 
cin >> x;

Code Example 2

#include <iostream> 
using namespace std; 
  
int main() 
{ 
    int age; 
  
    cout << "Enter your age:"; 
    cin >> age; 
    cout << "\nYour age is: " << age; 
  
    return 0; 
}

Learn ReactJs, React Native from akashmittal.com