Leap year or not in C++

Source code :

#include<iostream>

using namespace std;

int main()
{
    int year = 2016; //Change the year here

    if(year%4==0 || year%400==0 || year%100==0){
        cout<< year << " is a leap year";
    }else{
        cout<< year << " is not a leap year";
    }
   return 0;
}

Output :

2016 is a leap year

Output :


                

Comments :