Write a C program to compute the perimeter and area of a rectangle with a height of 7 inches and width of 5 inches.
Solution:
#include <stdio.h>
void main()
{
int p,a;
p=2*(7+5);
printf(“Perimeter of the Rectangle is: %d\n”,p);
a=7*5;
printf(“Area of the Rectangle is: %d\n”,a);
}
Output:
Perimeter of the Rectangle is: 24
Area of the Rectangle is: 35