C Program to Calculate Area of Right angle Triangle

C Program to Calculate Area of Right angle Triangle

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

Recommended C Programs

AuthorAdmin

My name is Devendra Dode. I am a full-stack developer, entrepreneur, and owner of Tutsmake.com. I like writing tutorials and tips that can help other developers. I share tutorials of PHP, Python, Javascript, JQuery, Laravel, Livewire, Codeigniter, Node JS, Express JS, Vue JS, Angular JS, React Js, MySQL, MongoDB, REST APIs, Windows, Xampp, Linux, Ubuntu, Amazon AWS, Composer, SEO, WordPress, SSL and Bootstrap from a starting stage. As well as demo example.

Leave a Reply

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