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",&amp;n);
 Square=n*n;
 Cube=n*n*n;
 printf("\nSquare: %d\nCube: %d",Square,Cube);
 getch();
}

Leave a Reply

Your email address will not be published. Required fields are marked *