Site icon T4Tutorials.com

Cube of a number Program in C, CPP, C Plus Plus (C++) with flowchart

Cube of a number Program in C, CPP, C Plus Plus (C++) with the flowchart.

Cube of a number Program in C++ Diagram

Flowchart for the Cube of a number

cube of a number program c,cpp flowchart
Figure: the cube of a number program C, CPP flowchart.

Program of Cube of a number in CPP, C Plus Plus (C++). 

#include<iostream>
#include<conio.h>
using namespace std;
int main() 
{ 
int x,result; 
cout<<"Enter any number to find its cube= "; 
cin>>x; 
result=x*x*x;
cout<<"\n The cube of n is= "<<result; 
getch();
return 0; 
}

Output

Figure: the cube of a number.

Program of Cube of a number in C

#include<stdio.h>
#include<conio.h>
int main() 
{ 
int n,result; 
printf("Enter any number to find its cube= "); 
scanf("%d",&n); 
result=n*n*n;
printf("\n The cube of n is=%d ",result); 
getch();
return 0; 
}

Output

cube root of number program in cplusplus flowchart
Figure: cube of a number program
Exit mobile version