C program to calculate the area of a rectangle
Posted by Samath
Last Updated: January 02, 2017

Write a program to calculate the area of a rectangle. The program will ask the user to enter the width and length of a rectangle, and then display the area of the rectangle.

A rectangle is a four-sided flat shape where every angle is a right angle (90°).

Code:

#include<stdio.h>
#include<conio.h>
 
int main() {
   int length;
   int breadth;
 
   printf("\nPlease Enter the Length of Rectangle : ");
   scanf("%d", &length);
 
   printf("\nPlease Enter the Breadth of Rectangle : ");
   scanf("%d", &breadth);
 
   printf("\nArea of Rectangle : %d", length * breadth);
 
   return (0);
}