Write a program that reads the length of one side of a cube and prints its volume.

#include <stdio.h> int main() { float side, volume; // Reading the length of one side of the cube printf(“Enter the length of one side of the cube: “); scanf(“%f”, &side); // Calculating volume volume = side * side * side; // Printing the volume printf(“Volume of the cube: %.2f\n”, volume); return 0; } Related Questions: … Read more

Write a program that reads three numbers and prints their sum, product, and average.

#include <stdio.h> int main() { float num1, num2, num3, sum, product, average; // Reading three numbers printf(“Enter three numbers: “); scanf(“%f %f %f”, &num1, &num2, &num3); // Calculating sum, product, and average sum = num1 + num2 + num3; product = num1 * num2 * num3; average = sum / 3; // Printing results printf(“Sum: … Read more