Get the App
SLTechnology News&Howtos  ›  Development  › 

How to judge leap years with C language

Shulou Source: shulou.com Published: 2022-06-01 01:50:54 10月01日 Update

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.

Tags: Leap year language article content appropriateness year idea new knowledge more conditions steps knowledge knowledge points articles details industry information information channels follow channels Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Information MySQL OPPO Reno Shulou Technology Redmi