Skip to content

Commit 001e33b

Browse files
problem 30 solved
1 parent dd24551 commit 001e33b

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

problem30/problem.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
তোমার বয়স কি odd নাকি even সংখ্যা সেটা চেক কর একটা ফাংশন দিয়ে। সেই ফাংশনকে কোন সংখ্যা প্যারামিটার হিসেবে দিলে, সেই সংখ্যা Even হলে ফাংশন true রিটার্ন করবে আর Odd হলে false রিটার্ন করবে।
2+
3+
Check whether your age is odd or even number with a function. If a number is given as a parameter to that function, the function will return true if that number is Even and false if it is Odd.

problem30/problem30.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/* তোমার বয়স কি odd নাকি even সংখ্যা সেটা চেক কর একটা ফাংশন দিয়ে।
2+
সেই ফাংশনকে কোন সংখ্যা প্যারামিটার হিসেবে দিলে, সেই সংখ্যা Even হলে ফাংশন true রিটার্ন করবে আর Odd হলে false রিটার্ন করবে।
3+
4+
Check whether your age is odd or even number with a function.
5+
If a number is given as a parameter to that function, the function will return true if that number is Even and false if it is Odd. */
6+
7+
8+
function oddOrEven(age){
9+
10+
if( age % 2 === 0){
11+
return true;
12+
}
13+
else{
14+
return false;
15+
}
16+
};
17+
18+
19+
const myAge =21;
20+
const checkMyAge = oddOrEven(myAge);
21+
console.log(checkMyAge);

0 commit comments

Comments
 (0)