AnkitWebLogic

Calculate Volume of Cylinder

Q6. WAP to calculate volume of cylinder. 1

#include<stdio.h>
void main()
{
   float r, h, v;
   printf("Enter Radius of a Cylinder:");
   scanf("%f",&r);
   printf("Enter Height of a Cylinder:");
   scanf("%f",&h);
   v = 3.14 * r * r * h;
   printf("Volume of Cylinder = %f",v);
}
Enter Radius of a Cylinder: 5
Enter Height of a Cylinder: 7
Volume of Cylinder = 549.5

Advertisement