Display the cube of the numbers up to a given intiger:
Input the number of the term:
Number is : 1 and the cube of 1 is : 1
Number is : 2 and the cube of 2 is : 8
Number is : 3 and the cube of 3 is : 27
Process returned 0 (0x0) execution time : 5.878 s
Press any key to continue.
using namespace std;
int main()
{
int n;
cout<<"\n\tEnter a Number: "; cin>>n;
cout<<"\n\tNumber is "<<n<<": and the Cube of "<<n<<" i.e. "<<n<<"^3 = "<<n*n*n;
return(0);
}
Comments
Leave a comment