[prog] Re: more C++

wolf wolf at wolfrising.net
Sun Dec 14 01:59:55 EST 2003


Hi, I was wondering if it's possible to change the way a response 
prints out say my number being entered by
the user is something like 98765, instead of the response printing You 
entered 98765 is there a way to make
it print You entered 9 8 7 6 5? So that it distinctly shows each number 
separately?  Also, are there specific places
you should make comments? I know my stuff doesn't do much at the moment 
but I was wondering if say before
the std::cout there should be a comment that says something like //this 
program prints the number entered by
a user. Should I already be adding comments or just wait until I get to 
a much longer program?  Thanks  :)


#include <iostream>

// function main begins program execution
int main()
{

int integer1;

    std::cout << "Enter a number!\n";

    std::cin>>integer1;

    std::cout << "You entered..."<< integer1 << std::endl;




    return 0;   // indicate that program ended successfully

} // end function main



More information about the Programming mailing list