Home / Programs / C Program to Calculate Area of Right angle Triangle
Programming Example

C Program to Calculate Area of Right angle Triangle

👁 2,354 Views
💻 Practical Program
📘 Step by Step Learning
In this program we will calculate Area of Right angle Triangle

Program Code

#include"stdio.h"
int main() {
   int base, height;
   float area;
 
   printf("\nEnter the base of Right Angle Triangle : \n");
   scanf("%d", &base);
 
   printf("\nEnter the height of Right Angle Triangle : \n");
   scanf("%d", &height);
 
   area = 0.5 * base * height;
   printf("\nArea of Right Angle Triangle : %f \n", area);
 
   return (0);
}

Output

Enter the base of Right Angle Triangle :
5

Enter the height of Right Angle Triangle :
8

Area of Right Angle Triangle : 20.000000
Press any key to continue . . .

How to learn from this program

First read the algorithm, then study the program code line by line. After that, compare the code with the output and finally go through the explanation. This approach helps learners understand both the logic and the implementation properly.