C Program to Calculate Area of Right angle Triangle
C Program for Beginners : Area of Right Angled Triangle
Right angle Triangle
|
Definition :
|
Program :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
#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); } |
Output :
1 2 3 |
Enter the base of Right Angle Triangle : 4 Enter the height of Right Angle Triangle : 8 Area of Right Angle Triangle : 16.0 |