C Programming · June 8, 2021 0

Write a Program To Input A Number And Display Its Cube In C ( i.e if we input 3 it gives 9)

Hello guys today i am sharing Program To Input A Number And Display Its Cube In C .

 

Here is The Program that you Can Copy and Compile IT .

#include<stdio.h>
#include <conio.h>
void main()
{
int n,cube;
printf("enter an number to get cube ");
scanf("%d",&n);
cube=n*n*n;
printf("the cube of given number is %d",cube);
getch();
}

If You are Using DevC++ than Use int main() Instead Of void main()

Output of Program To Input A Number And Display Its Cube In C

 

Hope You Will Understand . If you have any issue You can contact Me in my Facebook  .