Skip to content
Snippets Groups Projects
Select Git revision
  • 91f979132cfadadf2d1333aad4462f68279b1129
  • 2024ss default
  • 2023ss
  • 2022ss
  • 2021ss protected
5 results

calc-01.s

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;
    }