Monday, May 9, 2022

TO FIND LEAP YEAR BY USING CONDITIONAL STATEMENT #THEHACKERS@

 #include<iostream>

using namespace std;


int main()

{

    int year;

    cout<<" Enter the year:";

    cin>>year;

    if(year % 4 == 0)

    {

        if(year % 100 == 0)

        {

            if(year % 400 ==0)

            {

                cout<<" this a leap year.";

            }

            else

            {

                cout<<" this is not a leap year.";

            }

        }

        else

        {

            cout<<" this is a leap year.";

        }

    }

    else

    {

      cout<<" this is not a leap year.";  

    }

    return 0;

}

No comments:

Post a Comment

CONSTRUCTURE IN PARENT CLASS

class Parent {     public Parent()     {         System.out.println("Parent Constrcutor");     }              } class Child extend...