Complete the code below to calculate and print the volume of a square pyramid. Output should be informative and professional. This question is worth 25/100 points.
The formula for the volume of a square pyramid is:
V = (1/3) * l^2 * h
where l is the length and h is the height.
#include <stdio.h>
int main(void) {
//declare input variables
float l, h;
//declare output variables
float volume;
//prompt and read values for length and height
printf("Enter the length of the square pyramid: ");
scanf("%f", &l);
printf("Enter the height of the square pyramid: ");
scanf("%f", &h);
//calculate volume of the square pyramid
volume = (1/3) * l * l * h;
//output the volume of the square pyramid
printf("The volume of the square pyramid is: %.2f\n", volume);
return 0;
}