Find Leap Year - C Language Programming

Find either a input year is leap year or not.



Click here to open this program in Turbo C++

/**********************************************************
 Statement - Prefect Leap Year
 Programmer - Vineet Choudhary
 Written For - http://developerinsider.co
 **********************************************************/

#include <stdio.h>
#include <conio.h>

void main()
{
    int year;
    clrscr();
    
    printf("Enter the year : ");
    scanf("%d",&year);
    int temp=year/100;
    if(year%100==0)
    {
        if(temp%4==0)
        {
            printf("%d is leap year.",year);
        }
        else
        {
            printf("%d is ordinary year.",year);
        }
    }
    else
    {
        if(year%4==0)
        {
            printf("%d is leap year.",year);
        }
        else
        {
            printf("%d is ordinary year.",year);
        }
    }
    
    getch();
}
You've successfully subscribed to Developer Insider
Great! Next, complete checkout for full access to Developer Insider
Welcome back! You've successfully signed in
Success! Your account is fully activated, you now have access to all content.