Write a c program to find the cube of a number using function
#include<stdio.h>
#include<conio.h>
void main()
{
int cube(int);
int n;
clrscr();
printf("Enter the number: ");
scanf("%d",&n);
printf("Cube of %d is %d",n,cube(n));
getch();
}
int cube(int a)
{
return(a*a*a);
}
Output:
Enter the number: 3
No comments: