#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main() {
float b,h,a;
printf("please enter base and height; ");
scanf("%f %f",&b,&h);
a=1.0/2.0*b*h;
printf("the area of triangle with base %f and height %f is %f",b,h,a);
return 0;
}
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter