Write a C Program to find a Perimeter of Rectangle

Write a C Program to find a Perimeter of Rectangle

#include<stdio.h>
#include<conio.h>
int main()
{          int a,b;
            printf(“Enter value of length & breadth of rectangle:”);
            scanf(“%d %d”,&a,&b);
            printf(“Perimeter of rectangle is:%d”,2*(a+b));
            return 0;
}
OR
#include<stdio.h>
#include<conio.h>
int main()
{          int a,b;
            printf(“Enter value of length & breath of rectangle:”);
            scanf(“%d %d”,&a,&b);
            int p;
            p= 2*(a+b);
            printf(“Perimeter of rectangle is:%d”,p)
            return 0;
}
Output

You may also like...

Leave a Reply