Question : Write a C Program to find Area of Right Angled Triangle.
/*
Write a C Program to find Area of Right Angled Triangle.
Area = 0.5 * height * width
*/
#include <stdio.h>
int main()
{
float height, width;
float area;
printf("Enter height of the given triangle:\n ");
scanf("%f ", &height);
printf("Enter width of the given triangle:\n ");
scanf("%f", &width);
area = 0.5 * height * width;
printf("Area of right angled triangle is: %.3f\n", area);
return (0);
}
OUTPUT :
Enter height of the given triangle:
10
Enter width of the given triangle:
15
Area of right angled triangle is: 75.000
Thank you very much for reading carefully, if you have any other questions, you can share it with us through comments, if this information was important to you, please let us know through comments.
Please do comment and share.
Thank You.
No comments:
Post a Comment