source file name: sqcube.c
void main()
{
int n,sq,c;
clrscr();
printf("\n enter any number: ");
scanf("%d",&n);
sq=n*n;
c=n*n*n;
printf("\n Square =%d Cube=%d ",sq,c);getch();
}
output:
1. enter any number:12
Square =144 Cube=1728
2. enter any number: 9
Square =81 Cube=729
0 Comments
Post a Comment