Boolean data Types - Practical

Опубликовано: 04 Сентябрь 2023
на канале: ke
27
1

there are 4 Boolean operations and, or not and exclusive or:

And is only true when all conditions are true. (&&)
Or is true when both or either one of the conditions are true (||)
Exclusive or, as long as all conditions are true or false it returns a false (^)
not negates the condition (!)

A year is a leap year if it is divisible by 4 but not by 100 or if it is divisible by 400. So you can use the following Boolean expression to check whether a year is a leap year:

(year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)


На этой странице сайта вы можете посмотреть видео онлайн Boolean data Types - Practical длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь ke 04 Сентябрь 2023, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 27 раз и оно понравилось 1 зрителям. Приятного просмотра!