read more...
post by sanjay Vishwakarma
Sunday, October 3, 2010
write a program to accept a number from user and print its square and cube.
#include
#include
#include
void main()
{
int a,b,c;
clrscr();
printf("\n\t Enter the value of square and cube\t:\t");
scanf("%d",&a);
b=pow(a,2);
c=pow(a,3);
printf("\n\t\t\t\tsquare\t\t:\t%d\n\n\t\t\t\t cube\t\t:\t%d",b,c);
getch();
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment