fork download
  1. /******************************************************************************
  2.  
  3. Welcome to GDB Online.
  4. GDB online is an online compiler and debugger tool for C/C++.
  5. Code, Compile, Run and Debug online from anywhere in world.
  6.  
  7. *******************************************************************************/
  8. #include <stdio.h>
  9. #include <math.h>
  10. int main(void) {
  11. int userNum1;
  12. int userNum2;
  13. int userNum3;
  14. int userNum4;
  15.  
  16. scanf("%d", &userNum1);
  17. scanf("%d", &userNum2);
  18. scanf("%d", &userNum3);
  19. scanf("%d", &userNum4);
  20.  
  21. int productTotal;
  22. productTotal = userNum1 * userNum2 * userNum3 * userNum4;
  23. int numAverage;
  24. numAverage = (userNum1 + userNum2 + userNum3 + userNum4) / 4;
  25. printf("%d %d\n", productTotal, numAverage);
  26.  
  27. //////////////////////////////////////////////////////////////////
  28.  
  29. scanf("%lf", (double)userNum1);
  30. scanf("%lf", (double)userNum2);
  31. scanf("%lf", (double)userNum3);
  32. scanf("%lf", (double)userNum4);
  33.  
  34. productTotal = userNum1 * userNum2 * userNum3 * userNum4;
  35. numAverage = (userNum1 + userNum2 + userNum3 + userNum4) / 4;
  36.  
  37. printf("%.3lf", (double)numAverage);
  38.  
  39.  
  40. return 0;
  41. }
  42.  
  43.  
  44.  
Success #stdin #stdout 0.01s 5284KB
stdin
45
stdout
2098865760 -339582626
-339582626.000