C Program to Calculate Area of Right angle Triangle

In this tutorial, i am going to show you how to find area of right angle triangle in c program.

All C Programs and Algorithm to Find Area of Right angle Triangle

  • 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

Follow the below given algorithm to write program for area of right angle triangle: is as follow:

  • 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 result 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

More C Programming Tutorials

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *