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.180 tracks/c/exercises/leap/src/example.c
trackler-2.2.1.179 tracks/c/exercises/leap/src/example.c
trackler-2.2.1.178 tracks/c/exercises/leap/src/example.c
trackler-2.2.1.177 tracks/c/exercises/leap/src/example.c
trackler-2.2.1.176 tracks/c/exercises/leap/src/example.c
trackler-2.2.1.175 tracks/c/exercises/leap/src/example.c
trackler-2.2.1.174 tracks/c/exercises/leap/src/example.c
trackler-2.2.1.173 tracks/c/exercises/leap/src/example.c
trackler-2.2.1.172 tracks/c/exercises/leap/src/example.c
trackler-2.2.1.171 tracks/c/exercises/leap/src/example.c
trackler-2.2.1.170 tracks/c/exercises/leap/src/example.c
trackler-2.2.1.169 tracks/c/exercises/leap/src/example.c
trackler-2.2.1.167 tracks/c/exercises/leap/src/example.c
trackler-2.2.1.166 tracks/c/exercises/leap/src/example.c
trackler-2.2.1.165 tracks/c/exercises/leap/src/example.c
trackler-2.2.1.164 tracks/c/exercises/leap/src/example.c
trackler-2.2.1.163 tracks/c/exercises/leap/src/example.c
trackler-2.2.1.162 tracks/c/exercises/leap/src/example.c
trackler-2.2.1.161 tracks/c/exercises/leap/src/example.c
trackler-2.2.1.160 tracks/c/exercises/leap/src/example.c