write a program to find area of triangle in c easiest program in C. First of all think how to solve and how to write code . source code given below.
#include <stdio.h>
int main()
{
float b,h,A;
scanf("%f %f",&b,&h);
A = 0.5*b*h;
printf("%f ", A);
return 0;
}
Explain:
There are Three variables b,h, A, B means breath,H means height, A means area then we used scanf function for user input . And assign half into b into h assign A Then print our result.
Please write this code on your editor and run this program.
No comments:
Post a Comment