Code Box
-------------------------------------
/* program to print a square and cube of any number */
#include<stdio.h>
#include<conio.h>
void main()
{
int a,sq,cu;
printf("\nEnter a number:");
scanf("%d",&a);
sq=a*a;
cu=a*sq;
printf("\n--------------------");
printf("\n\t Number:%d",a);
printf("\n\t Square:%d",sq);
printf("\n\t Cube :%d",cu);
printf("\n--------------------");
getch();
}
No comments:
Post a Comment