two functions - one to compute square value, and the other to
compute cube value. Print the results from the functions.*/
#include
#include
int square(int);
int cube(int);
int main()
{
int a;
printf("Enter a number :");
scanf("%d",&a);
int b=square(a);
printf("\nSquare= %d",b);
b=cube(a);
printf("\nCube= %d",b);
getch();
}
int square(int x)
{
return x*x;
}
int cube(int x)
{
return x*x*x;
}
No comments:
Post a Comment