a program in C to find the leap year using ternary ?: operator or conditional operator.

Output:
Enter any year:
2000 is a leap Year.

Explanation
Include the #include<stdio.h> Standard Input-Output Library header file to ensures that the functions for input and output processes are accessible.
int main() function definition starts the execution of the program.
We declare an integer variable year to store the input year. We request the user to enter a year using printf function and read the input using scanf.
The use of ternary operator used in the program above is to find whether the year is a leap year or not.
The condition (year%4==0&&(year%100!=0||year%400==0)) validates whether a year is a leap year.
If the the given condition is true then the printf() function shows that the year is a leap year otherwise in else the printf() shows that the year is not a leap year.
Finally, the program returns 0 to specify successful execution of the program.


Previous :-->> 3. write a program in C that calculates student grades based on marks given using if else statements.
 -->> NEXT: 5. Write a program in C to find the roots of a quadratic equation using if-else commands.
-->>ALL Conditionl statements Programs