How to Calculate Area of Right angle Triangle using C Language

C ProgrammingProgramming

Cyber Security : Go from Zero to Hero

Most Popular

60 Lectures 5.5 hours

Master C and Embedded C Programming- Learn as you go

Best Seller

66 Lectures 5.5 hours

C Programming from scratch- Master C Programming

Best Seller

60 Lectures 8 hours

C Program to Calculate Area of Right angle Triangle

Definition :

Triangle having one angle of measure 90 degree is called Right angle Triangle.

Sides of Triangle are : base , height , hypotenuse.

You can compute the area of a Tr. if you know its any two sides.

Program :

``````
#include <stdio.h>

int main() {
int base, height;
float area;

printf("\nEnter the base of Right Angle Triangle : ");
scanf("%d", &base);

printf("\nEnter the height of Right Angle Triangle : ");
scanf("%d", &height);

area = 0.5 * base * height;
printf("\nArea of Right Angle Triangle : %f", area);

return (0);
}
``````

Output :

``````
Enter the base of Right Angle Triangle   : 4
Enter the height of Right Angle Triangle : 8
Area of Right Angle Triangle : 16.0
``````