Showing posts with label leap year. Show all posts
Showing posts with label leap year. Show all posts

Tuesday, June 16, 2020

Leap Year in C++

    #include<iostream>

    using namespace std;

    int main(){

 int y;

  cin>>y;

  if(y % 4 == 0){

    if(y % 100 == 0){

      if(y % 400 == 0){

        cout<<y<<" is a leap year";

      }

      else

        cout<<y<<" is not a leap year";

    }

    else

      cout<<y<<" is a leap year";

  }

  else

    cout<<y<<" is not a leap year";    

}

LeetCode 4 Median of Two Sorted Arrays in JavaScript

LeetCode 4, Median of Two Sorted Arrays , asks us to find the median of two already sorted arrays without actually merging them. The key ...

horizontal ads