Thursday, July 28, 2011

Cube,square,square_root of a given Number

#include<stdio.h>
#include<math.h>
void main()

{
int num,cube,square;
float sqr_root;
clrscr();
printf("Enter a Number\n");
scanf("%d",&num);
square=num*num;
cube=pow(num,3);
sqr_root=sqrt(num);
printf("Cube of the Number = %d",cube);
printf("\nSquare of the Number = %d",square);
printf("\nSquare_root of the Number = %f",sqr_root);
getch();
}

0 comments:

Post a Comment