Bhaiyon Write a program to check leap year | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Bhaiyon Write a program to check leap year

23rd Sep 2017, 5:46 PM
Adarsh Mishra
Adarsh Mishra - avatar
3 Answers
+ 3
Go to Code Playground section, use the Search bar by entering "leap year" then select C++ from the language filter menu, there's loads of examples for you to learn from. (Edit) If you see a copyright © mark on the code, don't forget to put credits for the code author on your modified version of the code. Hth, cmiiw
23rd Sep 2017, 6:31 PM
Ipang
23rd Sep 2017, 6:07 PM
Akbar Khalilzadeh
Akbar Khalilzadeh - avatar
+ 2
Just check. If year%4==0 year%100==0 year%400==0. If first 2 return true, leap year Elif 1 and 3 return true, leap year Else, not leap year
23rd Sep 2017, 11:12 PM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar