fork download
  1. #include <stdio.h>
  2.  
  3.  
  4. int main(){
  5.  
  6. int daysIn_CurrentFebruary = 29;
  7. int daysIn_January = 31;
  8. int daysIn_February = daysIn_CurrentFebruary;
  9. int daysIn_March = 31;
  10. int daysIn_April = 30;
  11. int daysIn_May = 31;
  12. int daysIn_June = 30;
  13. int daysIn_July = 31;
  14. int daysIn_August = 31;
  15. int daysIn_September = 30;
  16. int daysIn_October = 31;
  17. int daysIn_November = 30;
  18. int daysIn_December = 31;
  19. int daysInFirstHalf = daysIn_January + daysIn_February + daysIn_March + daysIn_April + daysIn_May + daysIn_June;
  20. int daysInSecondHalf = daysIn_July + daysIn_August + daysIn_September + daysIn_October + daysIn_November + daysIn_December;
  21. printf("Days in the first half of the current year: %d\n", daysInFirstHalf);
  22. printf("Days in the second half of the current year: %d\n", daysInSecondHalf);
  23. printf("Days in the current year: %d\n", daysInFirstHalf + daysInSecondHalf);
  24.  
  25. return 0;
  26. }
Success #stdin #stdout 0.01s 5280KB
stdin
Standard input is empty
stdout
Days in the first half of the current year: 182
Days in the second half of the current year: 184
Days in the current year: 366