To calculate the volume of the Pyramid, you need to ask user to enter breadth and height of Pyramid.

**Variables:**

1. **breadth** : (Datatype int): to represent the breadth 1 of the pyramid.

2. **height** : (Datatype int): to represent the height of the pyramid.

3. **volume_of_pyramid** : (Datatype float): to store volume of pyramid calculated.

**Formula:**

Volume of a Pyramid : (1/3) x Breadth x Height

```
/*
* 1000+ C programs + tutorials
*
*
* 12_calculate_volume_of_pyramid.c
*
*
* Created on: Oct 20, 2014
* Author: Code2care.org
*/
#include &tl;stdio.h>
//#include &tl;conio.h>
void main() {
int breadth;
int height;
float volume_of_pyramid;
// clrscr();
printf(" Program to calculate Volume of a Pyramid: ");
printf("\n\n Enter the Breadth of Pyramid : ");
scanf("%d", &breadth);
printf("\n\n Enter the Height of Pyramid : ");
scanf("%d", &height);
volume_of_pyramid = (1/3)*breadth*height;
printf("\n\n Volume of Pyramid with Breadth as %d and Height as %d = %f",breadth,height,volume_of_pyramid);
// getch();
}
```

**Output:**

```
Program to calculate Volume of a Pyramid :
Enter the Breadth of Pyramid: 2
Enter the Height of Pyramid: 5
Volume of Pyramid with Breadth as 2 and Height as 5 = 3.333333
```

The best way to learn C programming is to practice more and more programs. Code2care C Programming tutorials provide 1000+ programs in C that you can study and become an expert in the language. Programs are divided into categories depending upon type and complexity.

BSc. IT, BSc. Computer Science, BSc. IT, MSc. IT, MSc. Computer Science, MCA, BTech IT & BTech Engineers may find these programs very useful.

**More Posts related to C-program,**

- Calculate Volume of Cylinder
- Calculate Volume of Sphere
- Calculate Volume of Cube
- Calculate Volume of Ellipsoid
- Find Sum of two numbers
- Division between two numbers
- Calculate Area of Trapezoid
- Calculate Area of a Rectangle
- Calculate Volume of Pyramid
- Calculate Area of ellipse
- Find Difference of two numbers
- Calculate Volume of Cone
- Calculate Area of Square
- Calculate Area and Circumference of Circle
- Calculate Area of Parallelogram

**More Posts:**

- Android : DeviceMonitor] Sending Tracking request failed! Error - Android
- Cut, Copy and Paste commands for mac - MacOS
- How to make Text in TextView bold and italic in Android - Android
- Android Parsing Data for android-L failed Unsupported major.minor version 51.0 Error - Android
- Setting Java_Home Environment variable on Windows Operating System - Java
- Share Image to WhatsApp with Caption from your Android App - WhatsApp
- AlertDialog with image using ImageView Example - Android
- SharePoint PowerShell - How to get list item by ID using GetItemById - SharePoint
- How to add border to Android TextView - Android
- Delete Android Studio Projects - Android-Studio
- Submit html form on dropdown menu value selection or change using javascript - JavaScript
- list of jars required for hibernate 4.x.x - Java
- How to Change Text Size for Android ActionBar - Android
- Eclipse : A java Runtime Environment (JRE) or Java Development kit (JDK) must be available - Java
- SharePoint List redirect user after submitting form NewForm.aspx - SharePoint