Program to calculate area of rectangle




Here is a simple program to calculate the area of a rectangle



  1. #include <stdio.h>
  2. main ()
  3. {
  4. int length;
  5. int width;
  6. int area;
  7.  
  8. length = 10;
  9. width = 20;
  10.  
  11. area = length * width;
  12. printf("area of rectangle is : %d\n", area);
  13. }
  14.  


Check how this program compiles and run of a MAC.