Advertisement

/*Write a C program to compute the perimeter and area of a rectangle with a height of 7 inches and width of 5 inches. */
 
#include <stdio.h>
int main( )
{
    int a,p;
    a=7*5;
    p=2*(7+5);
    printf("Area of the rectangle is %d\n",a);
    printf("Perimeter of a rectangle = %d\n",p);
    return 0;
}

Output:

Area of the rectangle is 35
Perimeter of a rectangle is 24
   

Back

Post a Comment

0 Comments