Leap year logic program to find Leap year in C++

Leap year comes every 4 year. For example, consider years such as 2012, 2016, 2020 ...and so on, these are the leap years. In them February has 29 days. To implement in the program of C++ see the logic details after the program.

Leap year comes every 4 year. For example, consider years such as 2012, 2016, 2020 ...and so on, these are the leap years. In them February has 29 days. To implement in the program of C++ see the logic details after the program. Output of program is shown below.
 Leap properties output

```//coding by Himanshu singh
#include <iostream>
#include <stdio.h>
using namespace std;
int main()
{
int year;
cout<<"Enter a year to check if it is a leap yearn";
cin>>year;
if ( year%400 == 0)
cout<<year<<" is a leap year.n";
else if ( year%100 == 0)
cout<<year<<" is not a leap year.n";
else if ( year%4 == 0 )
cout<<year<<" is a leap year.n";
else
cout<<year<<" is not a leap year.n";
return 0;
}```
(Note : I am using Dev C++ to implement this logic I also recommend you the same for you, this is the best software for C++.)

Logic behind Leap year code-:
The logic is very simple, first we include header files iostream, stdio and string. Using namespace std is for standard use of standard input output stream like cout. We use an int term year, which is asked by user by "Cin" command. Now as soon as the year is entered the if else begins to work it first checks the year to be divisible by 400, then by 100, and then by 4. If it is compleately divisible by 4 and 400 then the year is a leap year else not Cout command will show the result.
This is the simple logic for leap year detection. Hope you like this tutorial. Please like and share it if you find it useful. Any suggestions and questions can be dropped into comment box below. And If you find this useful please follow me in Google plus and twitter.

Name

ltr
item
MindxMaster: Leap year logic program to find Leap year in C++
Leap year logic program to find Leap year in C++
Leap year comes every 4 year. For example, consider years such as 2012, 2016, 2020 ...and so on, these are the leap years. In them February has 29 days. To implement in the program of C++ see the logic details after the program.
https://1.bp.blogspot.com/-P6Y13SVgyFY/VX8IH-x4jLI/AAAAAAAAAM4/KkwzkCk42zE/s1600/output%2Bof%2Bleapyear.png
https://1.bp.blogspot.com/-P6Y13SVgyFY/VX8IH-x4jLI/AAAAAAAAAM4/KkwzkCk42zE/s72-c/output%2Bof%2Bleapyear.png
MindxMaster
http://www.mindxmaster.com/2015/06/simplest-logic-to-find-leap-year-in-c.html
http://www.mindxmaster.com/
http://www.mindxmaster.com/
http://www.mindxmaster.com/2015/06/simplest-logic-to-find-leap-year-in-c.html
true
5332415103371288268
UTF-8