Menu

Newbie in trouble!

Anonymous
2002-09-01
2012-09-26
  • Anonymous

    Anonymous - 2002-09-01

    Here's my code:
    #include <iostream>
    using namespace std;
    //Everything after the double slashes is a comment and ignored by the compiler.
    //This program calculates and prints the square and cube of the first 20 integers

    int main ()
    {
    cout << "My Name is Giddago" <<
    endl; //type your name instead

    cout << "Integer\tSquared\tCubed" <<endl;
    for(int i=1; i<=20; ++i)
    {//the following line is executed 20 times
    cout<<i<<'\t'<<i*i<<'\t'<<i*i*i<< endl;
    }
    cout <<"Press any key to continue...";
    cin.get();//stops the program so you can view the output return 0;
    }

    When I run it, nothing shows in the console.  This is for a programming class, so it's quite boring, by the way.  :-)

     
    • Mr. B.B.C.

      Mr. B.B.C. - 2002-09-03

      Created a console application project ?

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.