+ 2
assign a value
How to assign a value to a variable from user input
2 Answers
0
for example....if you want to read a number from user
cout<<"enter your number";
#takes the input from the user and stores it in n
cin>>n ;
0
//Declare a variable
int x;
cin>>x;
//assign value