Sha256: 1357f6f640253ba2e6091f0a34d7d2647b5c28f71514fd8f282893167778f1d8

Contents?: true

Size: 238 Bytes

Versions: 396

Compression:

Stored size: 238 Bytes

Contents

#include <stdbool.h>

bool is_leap_year(int year)
{
   if (year % 4 == 0) {
      if (year % 400 == 0) {
         return true;
      }
      if (year % 100 == 0) {
         return false;
      }
      return true;
   }
   return false;
}

Version data entries

396 entries across 396 versions & 1 rubygems

Version Path
trackler-2.2.1.119 tracks/c/exercises/leap/src/example.c
trackler-2.2.1.118 tracks/c/exercises/leap/src/example.c
trackler-2.2.1.117 tracks/c/exercises/leap/src/example.c
trackler-2.2.1.116 tracks/c/exercises/leap/src/example.c
trackler-2.2.1.115 tracks/c/exercises/leap/src/example.c
trackler-2.2.1.114 tracks/c/exercises/leap/src/example.c
trackler-2.2.1.113 tracks/c/exercises/leap/src/example.c
trackler-2.2.1.111 tracks/c/exercises/leap/src/example.c
trackler-2.2.1.110 tracks/c/exercises/leap/src/example.c
trackler-2.2.1.109 tracks/c/exercises/leap/src/example.c
trackler-2.2.1.108 tracks/c/exercises/leap/src/example.c
trackler-2.2.1.107 tracks/c/exercises/leap/src/example.c
trackler-2.2.1.106 tracks/c/exercises/leap/src/example.c
trackler-2.2.1.105 tracks/c/exercises/leap/src/example.c
trackler-2.2.1.104 tracks/c/exercises/leap/src/example.c
trackler-2.2.1.103 tracks/c/exercises/leap/src/example.c
trackler-2.2.1.102 tracks/c/exercises/leap/src/example.c
trackler-2.2.1.101 tracks/c/exercises/leap/src/example.c
trackler-2.2.1.100 tracks/c/exercises/leap/src/example.c
trackler-2.2.1.99 tracks/c/exercises/leap/src/example.c