I don't know if I am understanding your question but I hope this helps.
using namespace std;
int variable = 0;//initializes variable
cout<<"\nEnter a new value for the variable:";//prompt user for new value
cin>>variable; //read in the new value
cout<<variable;//display the variable on the screen
//This program uses the iostream objects (cin and cout) to obtain and display
//the values of the variable. Read more about cin and cout and
//streams in general.