Write a C program to find the area of a triangle. |
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Here's a simple C program to find the area of a triangle:
In this program, we first declare variables for the base, height, and area of the triangle. Then, we prompt the user to input the base and height of the triangle using
printf
andscanf
functions. Next, we calculate the area of the triangle using the formulaarea = 0.5 * base * height
. Finally, we display the calculated area usingprintf
.