C program to find square,cube and square root of a number.

#include<stdio.h>
#include<conio.h>
#include<math.h>
void main(){
float n,square,cube,sr;
clrscr();
printf("enter a Number\n");
scanf("%f",&n);
square=pow(n,2);
cube=pow(n,3);
sr=sqrt(n);
printf("square of %.2f=%.2f/n cube of%.2f=%.2f\n",n,square,n,cube);
printf("square root of %.2f = %.2f\n",n,sr);
getch();
}

No comments:

Post a Comment