fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. #include <stdio.h>
  5.  
  6. int main() {
  7. // Specified number of days to convert
  8. int days = 1329;
  9. int years, weeks, remaining_days;
  10.  
  11. // Calculate years
  12. years = days / 365;
  13. remaining_days = days % 365;
  14.  
  15. // Calculate weeks from the remaining days
  16. weeks = remaining_days / 7;
  17.  
  18. // Calculate remaining days after converting to years and weeks
  19. remaining_days = remaining_days % 7;
  20.  
  21. // Display the results
  22. printf("Number of days: %d\n", days);
  23. printf("Years: %d\n", years);
  24. printf("Weeks: %d\n", weeks);
  25. printf("Days: %d\n", remaining_days);
  26.  
  27. return 0;
  28. }
  29. return 0;
  30. }
  31.  
Success #stdin #stdout 0s 5256KB
stdin
Standard input is empty
stdout
Standard output is empty