Computer Science, asked by sunnymangipudi2001, 1 year ago

write the c-Programe to compute
Perimeter and area of the rectangle.
and the height of 7 inches and
width of 5 inches.​

Answers

Answered by sushiladevi4418
2

Answer:

Write the C-program to compute  the perimeter and area of the rectangle.

Explanation:

#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);

}

Output:  -

Perimeter of the rectangle = 24 inches                                

Area of the rectangle = 35 square inches

Similar questions