fork download
  1. #include <stdio.h>
  2. main ()
  3. {
  4. /* This program will calculate the usable area in square feet of three houses */
  5.  
  6. /* This program will assume that the houses have rectangular or square rooms */
  7. /* variable definition: */
  8. int a, b, c, d, e, f, g, h, i, j,k,l,m,n,o,p,q,r,s,t,aa,bb,cc,dd,ee,ff,gg,hh,ii,jj;
  9. /*variable initialization */
  10. a = 10;
  11. b = 14;
  12. c = a*b;
  13. d = 9;
  14. e = 10;
  15. f = d*e;
  16. g = 12;
  17. h = 12;
  18. i = g*h;
  19. j = c+f+i;
  20. k = 10;
  21. l = 10;
  22. m = k*l;
  23. n = 20;
  24. o = 18;
  25. p = n*o;
  26. q = 16;
  27. r = 17;
  28. s = q*r;
  29. t = m+p+r;
  30. aa = 8;
  31. bb = 8;
  32. cc = aa*bb;
  33. dd = 10;
  34. ee = 7;
  35. ff = dd*ee;
  36. gg = 8;
  37. hh = 9;
  38. ii = gg*hh;
  39. jj = cc+ff/ii;
  40.  
  41. printf("<<<First test case in home A is>>> \n");
  42. printf("First room length times width is %d * %d = %d \n",a,b,c);
  43. printf("Second room length times width is %d * %d = %d \n",d,e,f);
  44. printf("Third room length times width is %d * %d = %d \n",g,h,i);
  45. printf("Total square footage is %d square feet \n" ,j);
  46. printf("<<<Second test case in home B is>>> \n");
  47. printf("The expected square footage of the three rooms are as follows:\n");
  48. printf("The first room length times width is %d * %d = %d \n",k,l,m);
  49. printf("The second room is %d * %d = %d \n",n,o,p);
  50. printf("The third room is %d * %d = %d \n",q,r,s);
  51. printf("The total square footage of home B is %d square feet \n",t);
  52. printf("<<<The third test case in home C is>>> \n");
  53. printf("The first room length times width is %d * %d = %d \n",aa,bb,cc);
  54. printf("The second room length times width is %d * %d = %d \n",dd,ee,ff);
  55. printf("The third room length times width is %d * %d = %d \n",gg,hh,ii);
  56. printf("The total square footage of home C is %.2d square feet \n",jj);}
  57.  
  58.  
Success #stdin #stdout 0s 2112KB
stdin
Standard input is empty
stdout
<<<First test case in home A is>>> 
First room length times width is 10 * 14 = 140 
Second room length times width is 9 * 10 = 90 
Third room length times width is 12 * 12 = 144 
Total square footage is 374 square feet 
<<<Second test case in home B is>>> 
The expected square footage of the three rooms are as follows:
The first room length times width is 10 * 10 = 100 
The second room is 20 * 18 = 360 
The third room is 16 * 17 = 272 
The total square footage of home B is 477 square feet 
<<<The third test case in home C is>>> 
The first room length times width is 8 * 8 = 64 
The second room length times width is 10 * 7 = 70 
The third room length times width is 8 * 9 = 72 
The total square footage of home C is 64 square feet