{"id":16977,"date":"2021-08-12T09:25:33","date_gmt":"2021-08-12T03:55:33","guid":{"rendered":"https:\/\/python-programs.com\/?p=16977"},"modified":"2021-11-22T18:38:30","modified_gmt":"2021-11-22T13:08:30","slug":"python-program-to-calculate-surface-area-and-volume-of-a-cylinder","status":"publish","type":"post","link":"https:\/\/python-programs.com\/python-program-to-calculate-surface-area-and-volume-of-a-cylinder\/","title":{"rendered":"Python Program to Calculate Surface Area and Volume of a Cylinder"},"content":{"rendered":"

In the previous article, we have discussed Python Program to Check Pronic Number or Not<\/a>
\nCylinder :<\/strong><\/p>\n

A cylinder is a closed geometrical solid shape with two parallel bases joined by a curved surface.
\nThe bases are circular in shape.<\/p>\n

The following is the formula for calculating<\/p>\n

    \n
  1. The area of a cylinder = 2\u03c0r(r+h)<\/li>\n
  2. The volume of a cylinder = \u03c0r\u00b2h<\/li>\n<\/ol>\n

    where\u00a0 r = radius of the base circle<\/p>\n

    h = height of the curved surface<\/p>\n

    Given the radius and height of the cylinder, and the task is to calculate the surface area and volume of the given cylinder.<\/p>\n

    Examples:<\/strong><\/p>\n

    Example 1:<\/strong><\/p>\n

    Input:\u00a0<\/strong><\/p>\n

    Given radius = 2.5\r\nGiven height = 3.5<\/pre>\n

    Output:<\/strong><\/p>\n

    The surface area of a given cylinder = 137.44467859455347\r\nThe volume of a given cylinder = 68.72233929727673<\/pre>\n

    Example 2:<\/strong><\/p>\n

    Input:\u00a0<\/strong><\/p>\n

    Given radius = 7\r\nGiven height = 1.5<\/pre>\n

    Output:<\/strong><\/p>\n

    The surface area of a given cylinder = 461.81412007769956\r\nThe volume of a given cylinder = 230.90706003884978<\/pre>\n

    Program to Calculate Surface Area and Volume of a Cylinder<\/h2>\n

    Below are the ways to calculate the surface area and volume of the given cylinder.<\/p>\n