How to judge leap years with C language
In this article, the editor introduces in detail "how to judge a leap year in C language". The content is detailed, the steps are clear, and the details are handled properly. I hope this article "how to judge a leap year in C language" can help you solve your doubts. Let's follow the editor's ideas to learn new knowledge.
Direct conditional judgment of leap years:
# include int main () {int year; printf ("input year:"); scanf ("% d", & year); / / year = 400; / / (once every four years, no leap for a hundred years) | | four hundred years in a leap year if ((year% 4 = = 0 & year% 100! = 0) | | year% 400 = = 0) {printf ("y\ n") } else {printf ("n\ n");} return 0;} read here, this article "how to judge leap years in C language" has been introduced. If you want to master the knowledge of this article, you still need to practice and use it to understand it. If you want to know more about related articles, please follow the industry information channel.