We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cb96abc commit 7500293Copy full SHA for 7500293
beginner/ex4.js
@@ -1,3 +1,4 @@
1
+/*
2
// Doğum tarihi girilen kişinin yaşını hesaplayan programı yazınız.
3
function yasHesapla() {
4
const dYili = parseInt(prompt("Doğum yılınızı giriniz:", 1998));
@@ -9,9 +10,11 @@ function yasHesapla() {
9
10
let newMonth = date.getMonth();
11
let newDate = date.getDate();
12
- console.log(newYear);
13
console.log(`Yaşınız: ${newYear-dYili} yıl ${newMonth-dAy} ay ${newDate-dGun} gün`);
14
}
15
-yasHesapla();
+yasHesapla();
16
+*/
17
18
console.log("************ Exercise-4 ************");
19
+
20
+/* yorum satırlarını kaldırın */
beginner/ex5.js
@@ -0,0 +1,13 @@
+// Sayıları geriye yazdıran program
+function countDown(num) {
+ console.log(num);
5
+ const newNumber = num - 1;
6
+ if (newNumber >= 0) {
7
+ countDown(newNumber);
8
+ }
+}
+countDown(4);
+console.log("************ Exercise-5 ************");
beginner/ex6.js
@@ -0,0 +1,21 @@
+// Faktöriyel bulma programı
+function factorial(x) {
+ if ( x == 0) {
+ return 1;
+ else if (x < 0) {
+ return -1;
+ else {
+ return x * factorial(x-1);
+const num = 3;
+if ( num > 0) {
+ let result = factorial(num);
+ console.log(result);
21
+console.log("************ Exercise-6 ************");
beginner/index.html
@@ -9,7 +9,10 @@
<body>
<h1>Please open console</h1>
+ <script src="/beginner/ex6.js"></script>
+ <script src="/beginner/ex5.js"></script>
<script src="/beginner/ex4.js"></script>
<script src="/beginner/ex3.js"></script>
<script src="/beginner/ex2.js"></script>
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
0 commit comments