google.com, pub-6167773875660516, DIRECT, f08c47fec0942fa0 Write a c program to find the cube of a number using function - 2nd puc computer science

Write a c program to find the cube of a number using function

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

Cube of 3 is 27
Write a c program to find the cube of a number using function Write a c program to find the cube of a number using function Reviewed by Vision Academy on December 13, 2021 Rating: 5

No comments:

CheckOut

Powered by Blogger.