(03) Write a C program to compute the perimeter and area of a rectangle with a height of 7 inches and a width of 5 inches. Expected Output: The perimeter of the rectangle = 24 inches Area of the rectangle = 35 square inches
Answers
Answered by
8
Answer:
#include <stdio.h>
/* height and width of a rectangle in inches */
int width;
int height;
int area;
int perimeter;
int main() {
height = 7;
width = 5;
perimeter = 2*(height + width);
printf("Perimeter of the rectangle = %d inches\n", perimeter);
area = height * width;
printf("Area of the rectangle = %d square inches\n", area);
return(0);
}
Explanation:
Similar questions