C Program to Calculate Area and Perimeter of Rectangle - C Program

C Program to Calculate Area and Perimeter of Rectangle

#include<stdio.h>

 
int main() {
   int length, breadth, area,perimeter;
 
   printf("\nEnter the Length of Rectangle : ");
   scanf("%d", &length);
 
   printf("\nEnter the Breadth of Rectangle : ");
   scanf("%d", &breadth);
 
   area = length * breadth;
   
   perimeter=2*(length+breadth);

   printf("\nArea of Rectangle : %d", area);
   printf("\nPerimeter of Rectangle : %d", perimeter);

 
   return (0);
}

Output - C Program to Calculate Area and Perimeter of Rectangle

Enter the Length of Rectangle : 10                                                                                    
                                                                                                                      
Enter the Breadth of Rectangle : 4                                                                                    
                                                                                                                      
Area of Rectangle : 40                                                                                                
Perimeter of Rectangle : 28       
Compile and Run Online