// C program
#include<stdio.h>
int main()
{
int l,b,a,p;
printf("Enter the value of length and breadth:");
scanf("%d %d",&l,&b);
p=2*(l+b);
a=l*b;
printf("\nThe perimeter of a rectangle=%d",p);
printf("\nThe area of a rectangle=%d",a);
return 0;
}
Sample Input/Output:
Enter the value of length and breadth:10
5
The perimeter of a rectangle=30
The area of a rectangle=50
#include<stdio.h>
int main()
{
int l,b,a,p;
printf("Enter the value of length and breadth:");
scanf("%d %d",&l,&b);
p=2*(l+b);
a=l*b;
printf("\nThe perimeter of a rectangle=%d",p);
printf("\nThe area of a rectangle=%d",a);
return 0;
}
Sample Input/Output:
Enter the value of length and breadth:10
5
The perimeter of a rectangle=30
The area of a rectangle=50
No comments:
Post a Comment