Write a program in C to displays all leap year between given year to any given year.
#include<stdio.h> #include<conio.h> void main() { int y,n,n1; clrscr(); printf("Enter two year:-"); scanf("%d%d",&n,&n1); for(y=n;y<=n1;y++) { if(y%100!=0&&y%400==0||y%4==0) printf("%d is leap year\n",y); } getch(); }
Output:-
0 Comments