I’m asked to find the area of a trapazoid The script given below
I’m asked to find the area of a trapazoid The script given below is
what was in the example. Can someone explain what I’m missing?
/* variable definition: */
float baseA, baseB, height, area;
/* Prompt user for baseA */
printf(“Enter the first base of the trapezoid: 2.7 \n”);
// Input the base
scanf(“%f”, &baseA);
/* Prompt user for baseB */
printf(“Enter the second base of the trapezoid: 3.5 \n”);
// Input the baseB
scanf(“%f”, &baseB);
/* Prompt user for height */
printf(“Enter the height of the trapezoid: 5.3 \n”);
// Input the height
scanf(“%f”, &height);
// Calculate the Area
area= 0.5 * (baseA + baseB) * height;
// Print the result
printf(“Area is : %f\n”, area);
return 0;
}