Area of Rectangle: C Program


The length and breadth / width of a rectangle are entered through the keyboard. Write a program to calculate the area of the rectangle.

Rectangle is a quadrilateral(i.e., it has 4 sides). And all the 4 angles of the rectangle are of 90 degree. To calculate area of a rectangle we need its length and width/breadth.

Related Read:
Basic Arithmetic Operations In C
Perimeter of Rectangle: C Program

Note: Area of a Rectangle is calculated using the formula
Area = Length * Width;


area of rectangle

Length: is the length of the longest side of the rectangle.
width: is the length of the smallest side of the rectangle.

Find Area of a Rectangle: C Program



YouTube Link: https://www.youtube.com/watch?v=yvgxG0hGqsY [Watch the Video In Full Screen.]


Source Code: Find Area of a Rectangle: C Program

  1. #include < stdio.h >  
  2.   
  3. int main()  
  4. {  
  5.     float length, width, area;  
  6.   
  7.     printf("Enter length of rectangle\n");  
  8.     scanf("%f", &length);  
  9.   
  10.     printf("Enter width of rectangle\n");  
  11.     scanf("%f", &width);  
  12.   
  13.     area = length * width;  
  14.   
  15.     printf("Area of Rectangle is %f\n", area);  
  16.   
  17.     return 0;  
  18. }  

Output:
Enter length of rectangle
12
Enter width of rectangle
6
Area of Rectangle is 72.000000

For list of all c programming interviews / viva question and answers visit: C Programming Interview / Viva Q&A List

For full C programming language free video tutorial list visit:C Programming: Beginner To Advance To Expert

Leave a Reply

Your email address will not be published. Required fields are marked *