Skip to content

Commit dd24551

Browse files
problem 29 solved
1 parent fc79c57 commit dd24551

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

problem29/problem.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
leapYear() নামে ফাংশন লিখো এবং নেক্সট ইয়ার অর্থাৎ ২০২৩ কি leap year নাকি সেটা চেক করো। Leap year হলে ফাংশন true রিটার্ন করবে আর leap year না হলে false রিটার্ন করবে।
2+
3+
4+
Write a function called leapYear() and check whether the next year i.e. 2023 is a leap year or not. The function will return true if it is a leap year and false if it is not a leap year.

problem29/problem29.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
2+
3+
/* Write a function called leapYear() and check whether the next year i.e. 2023 is a leap year or not.
4+
The function will return true if it is a leap year and false if it is not a leap year. */
5+
6+
7+
function leapYear(year){
8+
9+
if((year % 4 === 0) && (year % 100 !== 0) || ( year % 400 === 0)){
10+
return true;
11+
}
12+
13+
else{
14+
return false;
15+
}
16+
};
17+
18+
19+
20+
const checkTheYear = 2023;
21+
const isLeapYear = leapYear(checkTheYear);
22+
console.log("Is",checkTheYear,"leap year?", " Answer:",isLeapYear,"." );

0 commit comments

Comments
 (0)