Skip to content
Snippets Groups Projects
Select Git revision
  • 82dc589057d13e5b711ac5a0af892fe9e29088b6
  • master default protected
2 results

README.md

Blame
  • loesung-1.1-03.c 550 B
    #include <stdio.h>
    
    int main (void)
    {
      int year = 42;
      printf ("Jahr: ");
      scanf ("%d", year);
      if (year % 4 == 0)
        {
          if (year % 400 == 0)
            {
              printf ("%d ist ein Schaltjahr.\n", year);
              return 0;
            }
          else if (year % 100 == 0)
            {
              printf ("%d ist kein Schaltjahr.\n", year);
              return 0;
            }
          else
            {
              printf ("%d ist ein Schaltjahr.\n", year);
              return 0;
            }
        }
      else
        printf ("%d ist kein Schaltjahr.\n", year);
      return 0;
    }