print square and cube
6.program to accept a number from user and print its square and cube.
#include<stdio.h>
#include<conio.h>
void main()
{
int n,sqre,cube;
clrscr();
printf("Enter Number: ");
scanf("%d",&n);
sqre=n*n;
cube=n*n*n;
printf("\nSquare: %d\nCube: %d",sqre,cube);
getch();
}
1 Comments:
Kkk
Post a Comment
Subscribe to Post Comments [Atom]
<< Home