C program to calculate perimeter and area of a rectangle

C program to calculate perimeter and area of a rectangle.Take length and breadth of ractangle as input.

Sol.
//C program to calculate perimeter and area of rectangle
#include <stdio.h> 

float widthOfRectangle, heightOfRectangle, areaOfRectangle, perimeterOfRectangle;      

int main() {
    printf(“Enter width of rectangle : n”);
    scanf(“%f”, &widthOfRectangle);
    
    printf(“Enter height of rectangle :n”);
    scanf(“%f”, &heightOfRectangle);
    
    //Perimeter of ractangle = 2*(width + height)
    perimeterOfRectangle = 2*(widthOfRectangle + heightOfRectangle);
    printf(“Perimeter of the rectangle = %fn”, perimeterOfRectangle);
    
    //Area of rectangle = width * height
    areaOfRectangle = widthOfRectangle * heightOfRectangle;
    printf(“Area of the rectangle = %fn”, areaOfRectangle);

return(0);
}
Output: