Write a program in 'C' to enter the base (b) and height (h) of a traingle and to calculate and print the area (a) where area = 1/2*base*height
#include< main() { float b, h, a; printf("Enter the value for base and height\n"); scanf("%f %f", &b, &h); a = 0.5* b*h; printf("The area is = %f\n", area); return(0); } |
---|
For eg :-
Output :-
Enter the value for base and height
5 8
The area is = 20.000000
0 comments:
Post a Comment