Thread: help please

  1. #1

    Unhappy help please

    im new to c++, ive looked at some tutorials but i just cant figure out how to get it to display the number that you entered for the variable.

    can someone please explain how and as simple as possible.


  2. #2
    i am having the same trouble. i think the code is right but the window goes away to fast.

  3. #3
    Still A Registered User DISGUISED's Avatar
    Join Date
    Aug 2001
    #include <iostream> 
    using namespace std; 
    int main()
    		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. 
    	return 0; 
    I don't know if I am understanding your question but I hope this helps.

Popular pages Recent additions subscribe to a feed