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 Conditional Operator ?


Q:- Write a C Program to Check Whether a Year is Leap Year or Not Using Conditional 
        Operators ?
Input

#include<stdio.h>
#include<conio.h>
#include<math.h>
int main()
{
int year;
clrscr();
printf("Enter a Year =");
scanf("%d",&year);
(year % 4==0)
? printf("%d is Leap Year.",year)
: printf("%d is not Leap Year.",year);
getch();
       }


Output

Enter a Year = 2016
2016 is Leap Year.

Comments