Learn about C Program to Find the Area of a Cube Using pow() Function in the below code example. Also refer the comments in the code snippet to get a detailed view about what’s actually happening.
C Program to Find the Area of a Cube Using pow() Function
A rectangle’s volume is equal to its length * width * height. If the box is a rectangular prism or a cube, we simply need to know its length, width, and height. Then we can multiply them to get volume. V = lwh is a common abbreviation for this formula.
Program:
#include<stdio.h>
#include<math.h>
int main()
{
double length, area;
printf("Enter length: ");
scanf("%lf",&length);
area = 6*pow(length,2);
printf("Area=%.2f",area);
return 0;
}
Output:
Enter length: 4
Area=96
Hope above code works for you and Refer the below Related Codes to gain more insights. Happy coding and come back again.
Similar Codes :
C Program to Find the Volume of a Cube
C Program to Find the Circumference of a Rectangle