Skip to content
Snippets Groups Projects
Select Git revision
  • b77c06670837eae51816cef758a9e64ecd62af69
  • 2023ss default protected
  • 2022ss
  • 2021ss
  • 2020ss
  • 2019ss
  • 2018ss
  • 2017ss
  • 2016ss
  • 2015ss
  • 2014ss
11 results

chardev-2.c

Blame
  • Forked from Peter Gerwinski / bs
    Source project has a limited visibility.
    loesung-1-1.c 544 B
    #include <stdio.h>
    
    int is_leap_year (int year)
    {
      int leap_year = 0;
      if (year % 4 == 0)
        {
          leap_year = 1;
          if (year % 100 == 0)
            {
              leap_year = 0;
              if (year % 400 == 0)
                leap_year = 1;
            }
        }
      return leap_year;
    }
    
    int main (void)
    {
      int year;
      printf ("Bitte geben Sie eine Jahreszahl ein: ");
      scanf ("%d", &year);
      if (is_leap_year (year))
        printf ("Das Jahr %d ist ein Schaltjahr.\n", year);
      else
        printf ("Das Jahr %d ist kein Schaltjahr.\n", year);
      return 0;
    }