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

Popular posts from this blog

Write a program to accept numerator and denominator and find the remainder without using modulus (%) operator using do..while loop.