Pages

Tuesday, February 9, 2016

Finding square(x*x) and cube(x*x*x) of a given number(x).

#include<stdio.h>
int main()
{
int number;

printf("Enter your number:");
scanf("%d",&number);

printf("Square of given number is %d \n", number*number);

printf("Cube of given number is %d", number*number*number);
   return 0;
}

Output of the program:

Enter your number:5
Square of given number is 25
Cube of given number is 125

No comments:

Post a Comment