평행사변형의 면이 주어지고 주어진 면으로 평행사변형의 둘레를 생성하고 결과를 표시하는 작업입니다.
평행사변형이란 무엇입니까?
평행사변형은 -
- 대향 평행
- 반대각이 같음
- 다각형 대각선이 서로 이등분합니다.
아래 그림에서 'a'와 'b'는 그림에서 평행한 변을 나타낸 평행사변형의 변입니다.

평행사변형의 둘레/원주는 다음과 같이 정의됩니다. -
평행사변형의 둘레 =2(a + b)
=2 * a + 2 * b
예시
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
알고리즘
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
예시
#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;
} 출력
Circumference of a parallelogram is : 70.00