Skip to main content

Write a program that will obtain the length and width of a rectangle from the user and compute its are a and perimeter. [Board Solve]


   #include<stdio.h>
    #include<conio.h>
    main()
    {
        float length, width, area, perimeter;
        
        printf("Enter the length and width of rectangle:");
        
        scanf("%f%f ",&length,&width);

        area=length*width;
        perimeter=2*length+2*width;

        printf("Result: %d",perimeter);
    
        getch();
    }