Program
#include<stdio.h>
void main()
{ float a,b,h;
printf("Enter the base : ");
scanf("%f",&b);
printf("Enter the height : ");
scanf("%f",&h);
a=0.5*b*h;
printf("Area is %f",a);
}
Output
Enter the base : 8
Enter the height : 6
Area is 24.00
#include<stdio.h>
void main()
{ float a,b,h;
printf("Enter the base : ");
scanf("%f",&b);
printf("Enter the height : ");
scanf("%f",&h);
a=0.5*b*h;
printf("Area is %f",a);
}
Enter the base : 8
Enter the height : 6
Area is 24.00