write a c program to find the area of a rectangle | CTechnotips

C program for area of a rectangle

Formula of area of rectangle:

Area = length * width

C code:


int main(){

    float l,w;
    float area;

    printf("Enter size of each sides of the rectangle : ");

    area = l * w;
    printf("Area of rectangle is: %.3f",area);

    return 0;

Sample output:

Enter size of each sides of the rectangle: 5.2 20
Area of rectangle is: 104.000


Post a Comment