C Program To Determine Leap Year or Not using Logical Operators

preview_player
Показать описание

Any year is entered through the keyboard, write a C program to determine whether the year is a leap year or not. Use the logical operators && and ||.

Leap Year Logic
1. If a year is a century year(year ending with 00) and if it’s perfectly divisible by 400, then it’s a leap year.
2. If the given year is not a century year and it’s perfectly divisible by 4, then it’s a leap year.

C Programming Interview / Viva Q&A List

C Programming: Beginner To Advance To Expert
Рекомендации по теме
Комментарии
Автор

You literally have best solution of every que in let us c

vnt_grg
Автор

if year%400 === 0, then u can omit the check for year%100 .. thank you

personzen