KodeGod.com

009. Write a program to accept a number from user and print it’s square & cube in C language

#include<stdio.h> 
#include<conio.h>  
main()
{
 int n, Square, Cube;
 clrscr();
 printf("Enter Number: ");
 scanf("%d",&n);
 Square=n*n;
 Cube=n*n*n;
 printf("\nSquare: %d\nCube: %d",Square,Cube);
 getch();
}