Saturday, August 9, 2014

Program to check for a leap year.

Simple C program to check whether a year is leap year or not. If you have any doubts, please let me know.

#include<stdio.h> void main() { int num; printf ("enter number"); scanf ("%d",&num); if(num%4==0&&num%100!=0)||(num%400==0) { printf ("leap year"); } else { printf ("no"); } }

No comments:

Post a Comment