Find perimeter of rectangle - C Program

C program to calculate perimeter of rectangle.

Solution:

This program is for finding perimeter of rectangle.

Formula: Perimeter of Rectangle = 2 * (L+B).

Where, L is the length of rectangle and B is Breadth of rectangle.

#include<stdio.h>
int main()
{
     int length, breadth, rect_perimeter;
     printf("Enter Length  : ");
     scanf("%d", &length);
     printf("Enter Breadth : ");
     scanf("%d", &breadth);
     rect_perimeter= 2*(length+breadth);
     printf("\nPerimeter of Rectangle = %d",rect_perimeter);
     return 0;
}


Output:

perimeter of rectangle