if...else
JavaScript
xxxxxxxxxx
function checkLeapYear(year) {
if ((0 == year % 4) && (0 != year % 100) || (0 == year % 400)) {
console.log(year + ' is a leap year');
} else {
console.log(year + ' is not a leap year');
}
}
const year = prompt('Enter a year:');
checkLeapYear(year);
Enter a year: 2000 2000 is a leap year
newDate()
JavaScript
xxxxxxxxxx
function checkLeapYear(year) {
const leap = new Date(year, 1, 29).getDate() === 29;
if (leap) {
console.log(year + ' is a leap year');
} else {
console.log(year + ' is not a leap year');
}
}
const year = prompt('Enter a year:');
checkLeapYear(year);
Enter a year: 2000 2000 is a leap year
Linux - كيفية تثبيت anc-api-tools
Linux - كيفية تثبيت curvedns
Python - تحقق مما إذا كان الرقم موجبًا أم سالبًا أم 0
Linux - كيفية تثبيت zenmap
C - عد عدد الأرقام في عدد صحيح
JavaScript - تحقق مما إذا كانت السلسلة تبدأ وتنتهي بأحرف معينة
C++ - تحقق مما إذا كان الرقم أوليًا أم لا
C - ابحث عن أكبر رقم باستخدام تخصيص الذاكرة الديناميكي
Kotlin - تقريب رقم إلى n منازل عشرية
C++ - تحقق من السنة الكبيسة
Kotlin - عكس رقم
Java - عكس رقم
Linux - كيفية تثبيت zfs-test
Linux - كيفية تثبيت zstd
Linux - كيفية تثبيت xbitmaps
Kotlin - أوجد عاملي العدد
Python - كتابة ملفات إكسل (XLSX)
Java - إنشاء الهرم والنمط
We have been online since 2021 and 1 millions of people around the globe have visited our website since then
More visitors every month