In this blog we will see how to write a programme in C++ to find the cube of the given number,you can do so by following the given steps below.
Step 1: Go to your C++ compiler and type the given codes below.
#include <iostream.h>
#include <conio.h>
void main ()
{
int num,res;
cout<<"Enter the number your choice";
cin>>num;
res=num*num*num;
cout<<"The cube of the given number is"<<res;
getch();
}
Step 2: Compile the file and run.
Step 1: Go to your C++ compiler and type the given codes below.
#include <iostream.h>
#include <conio.h>
void main ()
{
int num,res;
cout<<"Enter the number your choice";
cin>>num;
res=num*num*num;
cout<<"The cube of the given number is"<<res;
getch();
}
Step 2: Compile the file and run.
0 comments:
Post a Comment