help please

This is a discussion on help please within the C++ Programming forums, part of the General Programming Boards category; im new to c++, ive looked at some tutorials but i just cant figure out how to get it to ...

  1. #1
    jobo_likes_cake
    Guest

    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.

    Thanks

  2. #2
    Unregistered
    Guest
    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
    Posts
    499
    Code:
     
    #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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21