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. :-)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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. :-)
Created a console application project ?