# Skenz - How To Wiki

### Site Tools

cs:c_language:leap_year

# Differences

This shows you the differences between two versions of the page.

 cs:c_language:leap_year [2017/11/21 14:03]127.0.0.1 external edit cs:c_language:leap_year [2018/11/20 10:54]zioskenz 2018/11/20 10:54 zioskenz 2017/11/21 14:03 external edit 2018/11/20 10:54 zioskenz 2017/11/21 14:03 external edit Line 25: Line 25: int main(void){ int main(void){ - int bis=0; + int leap=0; int year; int year; Line 31: Line 31: scanf("​%d",​ &year); scanf("​%d",​ &year); - /* First solution: base on a support varible ​bis */ + /* First solution: base on a support varible ​leap */ if ( year%4==0 )   /* divisible by 4 */ if ( year%4==0 )   /* divisible by 4 */ - ​bis=1; + ​leap=1; if ( year%100==0 ) /* but not by 100 */ if ( year%100==0 ) /* but not by 100 */ - ​bis=0; + ​leap=0; if ( year%400==0 ) /* but year divisible by 400 are leap years */ if ( year%400==0 ) /* but year divisible by 400 are leap years */ - ​bis=1; + ​leap=1; - if ( bis==1 ){ + if ( leap==1 ){ printf("​%d is a leap year\n",​ year); printf("​%d is a leap year\n",​ year); }else{ }else{