fork download
  1. /* user defined structure type for a date */
  2. struct date
  3. {
  4. int month;
  5. int day;
  6. int year;
  7. };
  8.  
  9. #include <stdio.h>
  10. int main ()
  11. {
  12.  
  13. struct date today; /* defines a variable of type struct date */
  14.  
  15. today.month = 3;
  16. today.day = 2;
  17. today.year = 2026;
  18.  
  19. printf ("%d/%d/%d \n", today.month, today.day, today.year - 2000); /* Y2K Issue ? */
  20.  
  21. return (0);
  22.  
  23. }
Success #stdin #stdout 0.01s 5292KB
stdin
Standard input is empty
stdout
3/2/26