Tuesday, April 1, 2014

C Program to Calculate Area of Right angle Triangle

C Program for Beginners : Area of Right Angled Triangle

Right angle Triangle
 Definition :
  1. Triangle having one angle of measure 90 degree is called Right angle Triangle.
  2. Sides of Triangle are : base , height , hypotenuse.
  3. You can compute the area of a Tr. if you know its any two sides.

Program :
#include<stdio.h>
#include<conio.h>
void main()
{
int base,height;
float area;
clrscr();  // Clear Screen

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 * radius * radius;

printf("nArea of Right Angle Triangle : %f",area);
getch();
}
Output :
Enter the base of Right Angle Triangle   : 4
Enter the height of Right Angle Triangle : 8
Area of Right Angle Triangle : 16.0

No comments:

Post a Comment