C program to enter length and breadth of a rectangle and find its area.


C PROGRMAING




/**

To enter length and breadth of a rectangle and find its area.

 */


#include <stdio.h>


 main()

{

    int length, width, area;


    /*

     * Input length and width of rectangle

     */

    printf("Enter length of rectangle: ");

    scanf("%d", &length);

    printf("Enter width of rectangle: ");

    scanf("%d", &width);


    /* Calculate area of rectangle */

    area = (length * width);


    /* Print area of rectangle */

    printf("Area of rectangle = %d sq. units ", area);


  

}


                                            OUT PUT    

                                Enter length of rectangle: 6

                                Enter width of rectangle: 7

                                Area of rectangle = 42 sq. units

                                --------------------------------



*****************************************

                                                   

 Related Question

➤Write a C program to perform input/output of all basic data types. 

➤Write a C program to enter two numbers and find their sum.

➤Write a C program to enter two numbers and perform all arithmetic operations.
 
➤Write a C program to enter length and breadth of a rectangle and find its perimeter. 


➤Write a C program to enter radius of a circle and find its diameter, circumference and area. 

➤Write a C program to enter length in centimeter and convert it into meter and kilometer

 ➤Write a C program to enter temperature in Celsius and convert it into Fahrenheit

➤Write a C program to enter temperature in Fahrenheit and convert to Celsius 

Write a C program to convert days into years, weeks and days.
*********************************************