‘C’ program to calculate area and perimeter of a rectangle.
C File =>
/* Write a ‘C’ program to calculate area and perimeter of a rectangle. */
#include<stdio.h>
int main()
{
int l,b,a,p;
printf("\n Enter length and bredth of rectangle : ");
scanf("%d%d",&l,&b);
a=l*b;
p=2*(l+b);
printf("\n Area of rectangle = %d",a);
printf("\n Perimeter of rerectangle = %d",p);
return 0;
}
Comments
Post a Comment
Please do not enter any spam link in message.