# Skenz - How To Wiki

### Site Tools

cs:c_language:leap_year
Return to Home page

# 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 [2019/02/26 14:35] (current) 2018/11/20 10:54 zioskenz 2017/11/21 14:03 external edit Next revision Previous revision 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{

If you found any error, or if you want to partecipate to the editing of this wiki, please contact: admin [at] skenz.it

You can reuse, distribute or modify the content of this page, but you must cite in any document (or webpage) this url: https://www.skenz.it/cs/c_language/leap_year?do=diff&rev=1511269397&difftype=sidebyside
/web/htdocs/www.skenz.it/home/data/attic/cs/c_language/leap_year.1511269397.txt.gz ยท Last modified: 2019/02/26 14:35 (external edit)

Privacy Policy