Author Topic: Turbo C Program to calculate hypotenuse of right angle triangle  (Read 5432 times)

kathir

  • Administrator
  • Sr. Member
  • *****
  • Posts: 283
Here is the Turbo C Program to calculate hypotenuse of right angle triangle:
Code:
//Source Code Listing

#include <stdio.h>
#include <math.h>

void main()
{

   float a, b, c;

   printf("Enter Triangle Side A: ");
   scanf("%f", &a);
   printf("Enter Triangle Side B: ");
   scanf("%f", &b);

   c = sqrt(a * a + b * b);
   printf("Hypotenuse: %.4f", c);
}

 


Disclaimer: This web site is for educational and informational purposes only. Click here to read the Disclaimer.
Content copyright 2010-2014. Kathiresan. All rights reserved.
This page is using SMF version 2.0.1