Write a program to find the hypotenuse of a right angled triangle for the given base and height.
/* Write a program to find the hypotenuse of a right angled triangle
for the given base and height.*/
#include <stdio.h>
#include <math.h>
void main()
{
float
b,h,hyp;
printf("Enter the base :
");
scanf("%f",&b);
printf("Enter the height : ");
scanf("%f",&h);
hyp=sqrt(pow(b,2)+pow(h,2));
printf("The hypotenuse is %.3f\n",hyp);
getch();
}
Comments
Post a Comment