Program to find Perimeter / Circumference of Square and Rectangle in C++

C++Server Side ProgrammingProgramming

In this tutorial, we will be discussing a program to find the perimeter/ circumference of square and rectangle.

For this we will be provided with the side of the rectangle or square. Our task it to find the perimeter/ circumference of that square or rectangle.

Example

 Live Demo

#include <iostream>
using namespace std;
int Circumference(int l, int w) {
   return (2 * (l + w));
}
int main() {
   int l = 8, w = 8;
   int c = Circumference(l, w);
   cout << "Circumference is : "
   << c << endl;
   return 0;
}

Output

Circumference is : 32
raja
Published on 19-May-2020 15:10:02
Advertisements