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 check a given year is leap year or not.

Write a program in C to check a given year is leap year or not.

 #include<stdio.h>  
 #include<conio.h>  
  void main()  
   {  
   int y;  
   clrscr();  
   printf("Enter a year:-");  
   scanf("%d",&y);  
   if(y%100!=0&&y%400==0||y%4==0)  
     printf("%d is leap year\n",y);  
   else   
     printf("%d is not leap year\n",y);  
   getch();  
   }  

Output:

 






Post a Comment

0 Comments