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 7500293

Browse files
third commit
1 parent cb96abc commit 7500293

File tree

4 files changed

+42
-2
lines changed

4 files changed

+42
-2
lines changed

‎beginner/ex4.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/*
12
// Doğum tarihi girilen kişinin yaşını hesaplayan programı yazınız.
23
function yasHesapla() {
34
const dYili = parseInt(prompt("Doğum yılınızı giriniz:", 1998));
@@ -9,9 +10,11 @@ function yasHesapla() {
910
let newMonth = date.getMonth();
1011
let newDate = date.getDate();
1112
12-
console.log(newYear);
1313
console.log(`Yaşınız: ${newYear-dYili} yıl ${newMonth-dAy} ay ${newDate-dGun} gün`);
1414
}
15-
yasHesapla();
15+
yasHesapla();
16+
*/
1617

1718
console.log("************ Exercise-4 ************");
19+
20+
/* yorum satırlarını kaldırın */

‎beginner/ex5.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Sayıları geriye yazdıran program
2+
3+
function countDown(num) {
4+
console.log(num);
5+
const newNumber = num - 1;
6+
if (newNumber >= 0) {
7+
countDown(newNumber);
8+
}
9+
10+
}
11+
countDown(4);
12+
13+
console.log("************ Exercise-5 ************");

‎beginner/ex6.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Faktöriyel bulma programı
2+
3+
function factorial(x) {
4+
if ( x == 0) {
5+
return 1;
6+
}
7+
else if (x < 0) {
8+
return -1;
9+
}
10+
else {
11+
return x * factorial(x-1);
12+
}
13+
}
14+
15+
const num = 3;
16+
if ( num > 0) {
17+
let result = factorial(num);
18+
console.log(result);
19+
}
20+
21+
console.log("************ Exercise-6 ************");

‎beginner/index.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@
99
<body>
1010
<h1>Please open console</h1>
1111

12+
1213

14+
<script src="/beginner/ex6.js"></script>
15+
<script src="/beginner/ex5.js"></script>
1316
<script src="/beginner/ex4.js"></script>
1417
<script src="/beginner/ex3.js"></script>
1518
<script src="/beginner/ex2.js"></script>

0 commit comments

Comments
(0)

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