Calculate Volume of Cylinder


1. breadth : (Datatype int) : to represent the breadth a Cylinder.

2. height : (Datatype int) : to represent the height a Cylinder.

3. volume_of_cylinder : (Datatype long) : to store the volume of Cylinder result.


printf(): is used to display something on the console/screen. Format specifier %d in printf function is used to display a int variable on screen and %ld for long. \n is used to add a newline

scanf(): is used to fetch data inputted by the user on the console/screen using keyboard. %d in scanf is indicates that inputted text is of type int and %ld for long.


Volume of Cylinder : bredth x height

 * 1000+ C programs + tutorials
 * 10_calculate_volume_of_cylinder.c
 *  Created on: Oct 20, 2014
 *  Author:

#include <stdio.h>
//#include <conio.h>

void main() {

    int breadth,height;
	long volume_of_cylinder;

//	clrscr();

	printf(" Program to calculate Volume of a Cylinder :  ");

	printf("\n\n Enter the Breadth of Cylinder : ");
	scanf("%d", &breadth);
        printf("\n\n Enter the Height of Cylinder : ");
	scanf("%d", &height);
	volume_of_cylinder = breadth*height;
	printf("\n\n Volume of Cylinder with Breadth as %d and Height as %d = 

//	getch();

Program to calculate Volume of a Cylinder :
Enter the Breadth of Cylinder: 4
Enter the Height of Cylinder: 5
The volume of Cylinder with Breadth as 4 and Height as 5 = 20

Recent Posts:

Code2care is an initiative to publish and share varied knowledge in programming and technical areas gathered during day-to-day learnings and development activities.

Students and Software Developers can leverage this portal to find solutions to their various queries without re-inventing the wheel by referring to our easy to understand posts. Technical posts might include Learnings, Video Tutorials, Code Snippets, How Tos, Blogs, Articles, etc.