Write a program to display the square and the cube of 10 numbers

//this is a program to display the square and the cube of 10 numbers
#include<iostream>
#include<conio.h>

using namespace std;

int main()
{
int i,sqr,cube;

//Displaying the information

cout<<"\n\nDisplaying the Square and Cube of First 10 numbers: ";

//Displaying the Square and cube of the numbers

for(i=1;i<=10;i++)
{
sqr=i*i;
cube=sqr*i;

cout<<"\n "<<i<<"\n Squre= "<<sqr<<" Cube="<<cube<<"\n\n";

}

return 0;
}

Previous
Next Post »