Skip to main content

Problem Statement

Take length and breadth as input from the user and print the area of the rectangle.

Solution

#include <stdio.h>

int main() {
    float length, breadth;
    printf("Enter length and breadth: ");
    scanf("%f %f", &length, &breadth);
    printf("Area = %.2f\n", length * breadth);
    return 0;
}

Input

Enter length and breadth: 5 3

Output

Area = 15.00