Logo 
Search:

C Programming Articles

Submit Article
Home » Articles » C Programming » Homework HelpRSS Feeds

Program to find area of cube

Posted By: Aidan Evans     Category: C Programming     Views: 5241

Write a program to find area of cube.

Code for Program to find area of cube in C Programming

#include<stdio.h>
#include<math.h>

void main()
{
    float length,area;

        printf("The length of cube");
        if(scanf("%f",&length)==1)
        {
            area=pow(length,3);
            printf("The volume of cube is %f",area);
        }
        else
        {
            printf("error,enter correct value");
        }

}



=========================================OUTPUT==========================
The length of cube :3.2
The volume of cube is :32.768002

The length of cube :2.345
The volume of cube is :12.895214
  
Share: 


Didn't find what you were looking for? Find more on Program to find area of cube Or get search suggestion and latest updates.

Aidan Evans
Aidan Evans author of Program to find area of cube is from London, United Kingdom.
 
View All Articles

 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!