# Program for Circumference of a Parallelogram

Given the sides of Parallelogram then calculate the circumference.

**Examples :**

Input: a = 10, b = 8 Output: 36.00 Input: a = 25.12, b = 20.4 Output: 91.04

The opposite sides of a parallelogram are of equal length and parallel. The angles are pairwise equal but not necessarily 90 degree. The circumference of a Parallelogram can be computed as sum of two adjacent sides each multiplied by 2.

Formula used to calculate circumference of a Parallelogram:

(2*a)+(2*b)

## C++

`// C Program to calculate the ` `// Circumference of a Parallelogram. ` `#include <stdio.h> ` ` ` `float` `circumferenceparallelogram(` `float` `a, ` `float` `b) ` `{ ` ` ` `return` `((2 * a) + (2 * b)); ` `} ` ` ` `int` `main() ` `{ ` ` ` `float` `a = 10, b = 8; ` ` ` `printf` `(` `"Circumference of a given Parallelogram is : %.2f"` `, ` ` ` `circumferenceparallelogram(a, b)); ` ` ` `return` `0; ` `} ` |

*chevron_right*

*filter_none*

## Java

`// Java Program To Calculate ` `// Circumference of a Parallelogram ` `import` `java.io.*; ` ` ` `class` `GFG ` `{ ` ` ` `static` `float` `circumferenceparallelogram(` `float` `a, ` `float` `b) ` ` ` `{ ` ` ` `return` `((` `2` `* a) + (` `2` `* b)); ` ` ` `} ` ` ` ` ` `// Driver code ` ` ` `public` `static` `void` `main(String arg[]) ` ` ` `{ ` ` ` `float` `a = ` `10` `, b = ` `8` `; ` ` ` `System.out.print(` `"Circumference of a given Parallelogram is :"` `); ` ` ` `System.out.println(circumferenceparallelogram(a, b)); ` ` ` `} ` `} ` ` ` `// This code is contributed by Anant Agarwal. ` |

*chevron_right*

*filter_none*

## Python3

`# Python3 Program to calculate the ` `# Circumference of a Parallelogram ` ` ` `# Utility Function ` `def` `circumferenceparallelogram(a,b): ` ` ` `return` `((` `2` `*` `a) ` `+` `(` `2` `*` `b)) ` ` ` `# Driver Function ` `a ` `=` `10` `b ` `=` `8` ` ` `print` `(` `"Circumference of a given Parallelogram is :"` `, ` ` ` `round` `(circumferenceparallelogram(a, b),` `4` `)) ` ` ` `# This code is contributed ` `# by Azkia Anam. ` |

*chevron_right*

*filter_none*

## C#

`// C# Program To Calculate ` `// Circumference of a Parallelogram ` `using` `System; ` ` ` `class` `GFG ` `{ ` ` ` `static` `float` `circumferenceparallelogram(` `float` `a, ` ` ` `float` `b) ` ` ` `{ ` ` ` `return` `((2 * a) + (2 * b)); ` ` ` `} ` ` ` ` ` `// Driver code ` ` ` `public` `static` `void` `Main() ` ` ` `{ ` ` ` `float` `a = 10, b = 8; ` ` ` `Console.Write(` `"Circumference of a"` `+ ` ` ` `"given Parallelogram is :"` `); ` ` ` ` ` `Console.Write(circumferenceparallelogram(a, b)); ` ` ` `} ` `} ` ` ` `// This code is contributed by vt_m. ` |

*chevron_right*

*filter_none*

## PHP

`<?php ` `// PHP Program to calculate ` `// the Circumference of a ` `// Parallelogram. ` ` ` `function` `circumferenceparallelogram( ` `$a` `, ` `$b` `) ` `{ ` ` ` `return` `((2 * ` `$a` `) + (2 * ` `$b` `)); ` `} ` ` ` ` ` `$a` `= 10; ` `$b` `= 8; ` ` ` `echo` `"Circumference of a "` `. ` ` ` `"given Parallelogram is : "` `, ` ` ` `circumferenceparallelogram(` `$a` `, ` `$b` `); ` ` ` ` ` `// This code is contributed by anuuj_67. ` `?> ` |

*chevron_right*

*filter_none*

**Output :**

Circumference of a given parallelogram is : 36.00

## Recommended Posts:

- Program to find Circumference of a Circle
- Program to find Perimeter / Circumference of Square and Rectangle
- Program to find the Area of a Parallelogram
- Program to print the hollow numerical parallelogram
- Program to calculate area of inner circle which passes through center of outer circle and touches its circumference
- Program to calculate angle on circumference subtended by the chord when the central angle subtended by the chord is given
- Find all possible coordinates of parallelogram
- Check whether four points make a parallelogram
- Area of a triangle inside a parallelogram
- Find the Missing Point of Parallelogram
- Perimeter and Area of Varignon's Parallelogram
- Find area of parallelogram if vectors of two adjacent sides are given
- Program for sum of cos(x) series
- Program for EMI Calculator
- Program to calculate age

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.