Practical - 6 - Write a program to find the volume of cylinder. (V = PI * r * r * h).

Practical - 6

Aim: Write a program to find the volume of cylinder. (V = PI * r * r * h).

Program:

#include <stdio.h>

#include <conio.h>

 

void main()

{

    clrscr();

    float PI = 3.14, r, h, v;

 

    printf("Enter the Radius = ");

    scanf("%f", &r);

 

    printf("Enter the Height = ");

    scanf("%f", &h);

 

    v = PI * r * r * h;

 

    printf("\nThe Volume = %f", v);

 

    getch();

}

 

 

Output:

Enter the Radius = 7

Enter the Height = 5

 

The Volume = 769.300049

 

Algorithm:

 

Step-1: START

Step-2: Declare PI = 3.14, r, h, v.

Step-3: Enter the value of r and h.

Step-4: v = PI * r * r * h.

Step-5: Display v.

Step-6: STOP

 

Flowchart:




 

Post a Comment

0 Comments
* Please Don't Spam Here. All the Comments are Reviewed by Admin.