fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. // Setting integer length values
  5.  
  6. int rm1length = 11;
  7. int rm2length = 12;
  8. int rm3length = 13;
  9. int rm4length = 14;
  10.  
  11. // Setting integer width values
  12.  
  13. int rm1width = 6;
  14. int rm2width = 7;
  15. int rm3width = 8;
  16. int rm4width = 9;
  17.  
  18. /*Summing up the area for each room by multuplying length * Width
  19. for each room*/
  20.  
  21. int rm1area = rm1length * rm1width;
  22. int rm2area = rm2length * rm2width;
  23. int rm3area = rm3length * rm3width;
  24. int rm4area = rm4length * rm4width;
  25.  
  26. /*Printing the area of each room so it will be understood in
  27. the total area output*/
  28.  
  29. printf("Room 1 area is %d \n", rm1area);
  30. printf("Room 2 area is %d \n", rm2area);
  31. printf("Room 3 area is %d \n", rm3area);
  32. printf("Room 4 area is %d \n", rm4area);
  33.  
  34. printf("In the next statement below this I will add the total area for my house \n");
  35.  
  36. int totalarea = rm1area + rm2area + rm3area + rm4area;
  37.  
  38. printf("The total area of all 4 rooms is %d", totalarea);
  39. return 0;
  40. }
  41.  
  42.  
  43.  
Success #stdin #stdout 0s 2160KB
stdin
Standard input is empty
stdout
Room 1 area is 66 
Room 2 area is 84 
Room 3 area is 104 
Room 4 area is 126 
In the next statement below this I will add the total area for my house 
The total area of all 4 rooms is 380