adsense

Hii, welcome to my site. My name is Om prakash kartik. This blog helps you to learn programming languages concepts.

Write a program in C to displays all leap year between given year to any given year.

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:-


Post a Comment

0 Comments