HTML Tutorial || Networking Assignment || Computer Full Forms || Ms-Office Shortcut Keys || Ms-Office Notes || Number System Notes || Internet Assignment
JavaScript Tutorial || CSS Tutorial || Operating System Notes || History of Computer Assignment || Netwoking Notes || Computer Fundamentals Notes

C Program to Check Whether a Year is Leap Year or Not Using If Else ?


Q:- Write a C Program to Check Whether a Year is Leap Year or Not Using If Else ?
     Input
      #include<stdio.h>
      #include<conio.h>
      int main()
   {
int year;
clrscr();
printf(“Enter a Year =”);
scanf(“%d”,&year);
if(year % 4==0)
{
printf(“%d is Leap Year.”,year);
}
else
{
printf(“%d is not Leap Year.”,year);
}
getch();
     }


Output

Enter a Year = 2016
2016 is Leap Year.

Comments