KodeGod.com

062. Write a program to calculate square and cube of a given number in C language


#include<stdio.h>
#include<conio.h>  

int square(int x)
{
	return(x*x);
}

int qube(int x)
{
	return(x*x*x);
}
main()
{
	int n;
	clrscr();
	printf("Enter number.....");
	scanf("%d",&n);
	printf("\nSquare : %d\n",square(n));
	printf("\nQube   : %d\n",qube(n));
	qube(n);
	getch();
}