C Program To Check Leap Year

  • Uploaded by: Saiyasodharan
  • 0
  • 0
  • April 2020
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View C Program To Check Leap Year as PDF for free.

More details

  • Words: 148
  • Pages: 1
LEAP YEAR OR NOT Program Logic: If the year is divisible by 4, it is a leap year. But, if it is divisible by 100, it is not. If the year is divisible by 400, it is a leap year. Examples: 1. 1996 is a leap year. (divisible by 4) 3. 2100 is a not leap year. (divisible by 100) 2. 2000 is a leap year. (divisible by 100 but also divisible by 400) Program: #include<stdio.h> #include void main() { int year; clrscr(); printf("Enter a Year to check : "); scanf("%d", &year); if(year % 400 == 0) printf("%d is a Leap Year.", year); else if(year % 100 == 0) printf("%d is not a Leap Year.", year); else if(year % 4 == 0) printf("%d is a Leap Year.", year); else printf("%d is not a Leap Year", year); printf("\nPress any key to Quit..."); getch(); } More useful programs @ http://www.gethugames.in/blog/

Related Documents

C Program
May 2020 12
Frog Leap
May 2020 14
C++ To Objective-c
December 2019 18
Frog Leap
April 2020 23

More Documents from "Banhi"