# Program to Calculate the Perimeter of a Decagon

Given side of a Decagon, the task is to find out the Perimeter of the Decagon.

**Explanation : **In geometry, a decagon is a ten-sided polygon or 10-gon. A regular decagon has all sides of equal length and each internal angle will always be equal to 144 degrees.

**Examples**:

Input : S = 5 Output : The Perimeter of Decagon is : 50 Input : S = 8 Output : The Perimeter of Decagon is : 80

**The formula for finding the Perimeter of the Decagon is:**

Perimeter = 10 * S where "S" is the side of the Decagon

Below is the program to find perimeter of decagon:

## C++

`// C++ program to Calculate the Perimeter of a Decagon ` `#include <iostream> ` `using` `namespace` `std; ` ` ` `// Function for finding the perimeter ` `void` `CalPeri() ` `{ ` ` ` `int` `s = 5, Perimeter; ` ` ` ` ` `Perimeter = 10 * s; ` ` ` ` ` `cout << ` `"The Perimeter of Decagon is : "` ` ` `<< Perimeter; ` `} ` ` ` `// Driver code ` `int` `main() ` `{ ` ` ` `CalPeri(); ` ` ` ` ` `return` `0; ` `} ` |

*chevron_right*

*filter_none*

## C

`// C program to Calculate the Perimeter of a Decagon ` `#include <stdio.h> ` ` ` `// Function for finding the perimeter ` `void` `CalPeri() ` `{ ` ` ` `int` `s = 5, Perimeter; ` ` ` ` ` `Perimeter = 10 * s; ` ` ` ` ` `printf` `(` `"The Perimeter of Decagon is : %d"` `, ` ` ` `Perimeter); ` `} ` ` ` `// Driver code ` `int` `main() ` `{ ` ` ` `CalPeri(); ` ` ` ` ` `return` `0; ` `} ` |

*chevron_right*

*filter_none*

## Java

`/*package whatever //do not write package name here */` `// Java program to Calculate the Perimeter of a Decagon ` ` ` `import` `java.io.*; ` ` ` `class` `GFG { ` ` ` `// Function for finding the perimeter ` `static` `void` `CalPeri() ` `{ ` ` ` `int` `S = ` `5` `, Perimeter; ` ` ` ` ` `Perimeter = ` `10` `* S; ` ` ` ` ` `System.out.println(` `"The Perimeter of Decagon is : "` `+ ` ` ` `Perimeter); ` `} ` ` ` `// Driver code ` ` ` `public` `static` `void` `main (String[] args) { ` ` ` `CalPeri(); ` ` ` `} ` `} ` `//This Code is contributed by ajit ` |

*chevron_right*

*filter_none*

## Python3

`# Python3 program to Calculate ` `# the Perimeter of a Decagon ` ` ` `# Function for finding the ` `# perimeter ` `def` `CalPeri(): ` ` ` `s ` `=` `5` ` ` `Perimeter ` `=` `10` `*` `s ` ` ` ` ` `print` `(` `"The Perimeter of Decagon is : "` ` ` `, Perimeter) ` ` ` `# Driver code ` `if` `__name__ ` `=` `=` `'__main__'` `: ` ` ` `CalPeri(); ` ` ` `# This code is contributed by ` `# Surendra_Gangwar ` |

*chevron_right*

*filter_none*

## C#

`// C# program to Calculate the ` `// Perimeter of a Decagon ` `using` `System; ` ` ` `class` `GFG ` `{ ` ` ` `// Function for finding the perimeter ` `static` `void` `CalPeri() ` `{ ` ` ` `int` `S = 5, Perimeter; ` ` ` ` ` `Perimeter = 10 * S; ` ` ` ` ` `Console.WriteLine(` `"The Perimeter of "` `+ ` ` ` `"Decagon is : "` `+ ` ` ` `Perimeter); ` `} ` ` ` `// Driver code ` `public` `static` `void` `Main () ` `{ ` ` ` `CalPeri(); ` `} ` `} ` ` ` `// This Code is contributed ` `// by anuj_67 ` |

*chevron_right*

*filter_none*

## PHP

`<?php ` `// PHP program to Calculate the Perimeter of a Decagon ` `function` `CalPeri(` `$s` `) ` `{ ` ` ` `$Perimeter` `= 10 * ` `$s` `; ` ` ` `echo` `"The Perimeter of Decagon is : $Perimeter"` `; ` `} ` ` ` `// Driver Code ` `$s` `= 5; ` `CalPeri(` `$s` `); ` `?> ` |

*chevron_right*

*filter_none*

**Output:**

The Perimeter of Decagon is : 50

## Recommended Posts:

- Program to calculate area and perimeter of Trapezium
- Program to calculate area and perimeter of equilateral triangle
- Program to calculate area and perimeter of a rhombus whose diagonals are given
- Program to calculate the Area and Perimeter of Incircle of an Equilateral Triangle
- Program for Area And Perimeter Of Rectangle
- C Program for Find the perimeter of a cylinder
- Program to find the Area and Perimeter of a Semicircle
- Program to find the Perimeter of a Regular Polygon
- Python Program for Find the perimeter of a cylinder
- Java Program for Find the perimeter of a cylinder
- Program to find Perimeter / Circumference of Square and Rectangle
- Python Program for Program to calculate area of a Tetrahedron
- Java Program for Program to calculate area of a Tetrahedron
- Diagonal of a Regular Decagon
- Area of decagon inscribed within the circle

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.