Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 21b9dcb

Browse files
initial commit
1 parent 183e04e commit 21b9dcb

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

‎Day1/Functions.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/*
2+
* Create the function factorial here
3+
* Recursion : To call itself is called recursion.
4+
*/
5+
function factorial(n) {
6+
if (n === 0) {
7+
return 1;
8+
}
9+
return n * factorial(n - 1);
10+
}

‎Day1/LetAndConst.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
function main() {
2+
// Write your code here. Read input using 'readLine()' and print output using 'console.log()'.
3+
let r = readLine();
4+
const PI = Math.PI;
5+
// Print the area of the circle:
6+
console.log(PI * (r * r) );
7+
// Print the perimeter of the circle:
8+
console.log(2 * PI * r);
9+
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /