C program to find area of right angle triangle; Through this tutorial, we will learn how to find area of right angle triangle in c program.
Programs and Algorithm to Find Area of Right angle Triangle
Use the following algorithm and program to find area of right angle triangle in c:
- Algorithm to Find Area of Right angle Triangle
- C Program to Find Area of Right angle Triangle
Algorithm to Find Area of Right angle Triangle
- Take a input height and base from user in program and store in variables.
- Calculate area of right angle triangle using area = 0.5 * base * height;
- Print area of right angle triangle.
C Program to Find Area of Right angle Triangle
#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); }
The output of the above c program; as follows:
Enter the base of Right Angle Triangle : 10 Enter the height of Right Angle Triangle : 5 Area of Right Angle Triangle : 25.000000