- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
C Program for Circumference of a Parallelogram
We are given with the sides of parallelogram and the task is to generate the circumference of a parallelogram with its given sides and display the result
What is a Parallelogram?
Parallelogram is a type of quadratic which have −
- Opposite sides parallel
- Opposite angles equal
- Polygon diagonals bisects each other
Shown in the below figure ‘a’ and ‘b’ are the sides of a parallelogram where parallel sides are shown in the figure.
Perimeter/Circumference of a parallelogram is defined as −
Circumference of Parallelogram = 2(a + b)
= 2 * a + 2 * b
Example
Input-: a = 23 and b = 12 Output-: Circumference of a parallelogram is : 70.00 Input-: a = 16.2 and b = 24 Output-: Circumference of a parallelogram is : 80.4
Algorithm
START Step 1-> Declare function to calculate circumference of parallelogram float circumference(float a, float b) return ((2 * a) + (2 * b)) Step 2-> In main() Declare float a = 23, b = 12 Call circumference(a, b) STOP
Example
#include <stdio.h> //function for circumference of parallelogram float circumference(float a, float b) { return ((2 * a) + (2 * b)); } int main() { float a = 23, b = 12; printf("Circumference of a parallelogram is : %.2f", circumference(a, b)); return 0; }
Output
Circumference of a parallelogram is : 70.00
- Related Articles
- Program to find Circumference of a Circle in C++
- Program to find the Area of a Parallelogram in C++
- Java program to find the circumference of a circle
- Program to find Perimeter / Circumference of Square and Rectangle in C++
- C++ program to find circumference of the circular pond with radius R
- Program to Print Mirrored Hollow Parallelogram in C
- Swift Program to Find the Area of a Parallelogram
- Java Program to Find the Area of a Parallelogram
- Kotlin Program to Find the Area of a parallelogram
- Area of a triangle inside a parallelogram in C++
- Program for factorial of a number in C program
- C++ Program for Derivative of a Polynomial
- C++ Perimeter and Area of Varignon’s Parallelogram
- C Program for focal length of a lens
- C Program for Program to find the area of a circle?

Advertisements