Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Yasin Ergüt
Hesap makinesi
Commits
29abb2e3
Commit
29abb2e3
authored
Jan 06, 2026
by
Yasin Ergüt
Browse files
islemler.js
parent
ea45e70b
Changes
1
Hide whitespace changes
Inline
Side-by-side
islemler.js
0 → 100644
View file @
29abb2e3
let
sayilar
=
[];
let
islemler
=
[];
function
islemEkle
(
islem
)
{
let
sayi
=
Number
(
document
.
getElementById
(
"
sayi
"
).
value
);
sayilar
.
push
(
sayi
);
islemler
.
push
(
islem
);
document
.
getElementById
(
"
ifade
"
).
innerText
+=
sayi
+
islem
;
document
.
getElementById
(
"
sayi
"
).
value
=
""
;
}
function
hesapla
()
{
let
sayi
=
Number
(
document
.
getElementById
(
"
sayi
"
).
value
);
sayilar
.
push
(
sayi
);
for
(
let
i
=
0
;
i
<
islemler
.
length
;
i
++
)
{
if
(
islemler
[
i
]
===
"
*
"
||
islemler
[
i
]
===
"
/
"
)
{
let
sonuc
;
if
(
islemler
[
i
]
===
"
*
"
)
{
sonuc
=
sayilar
[
i
]
*
sayilar
[
i
+
1
];
}
else
{
sonuc
=
sayilar
[
i
]
/
sayilar
[
i
+
1
];
}
sayilar
[
i
]
=
sonuc
;
sayilar
.
splice
(
i
+
1
,
1
);
islemler
.
splice
(
i
,
1
);
i
--
;
}
}
let
sonuc
=
sayilar
[
0
];
for
(
let
i
=
0
;
i
<
islemler
.
length
;
i
++
)
{
if
(
islemler
[
i
]
===
"
+
"
)
{
sonuc
+=
sayilar
[
i
+
1
];
}
if
(
islemler
[
i
]
===
"
-
"
)
{
sonuc
-=
sayilar
[
i
+
1
];
}
}
document
.
getElementById
(
"
sonuc
"
).
innerText
=
sonuc
;
document
.
getElementById
(
"
sayi
"
).
value
=
sonuc
;
sayilar
=
[];
islemler
=
[];
document
.
getElementById
(
"
ifade
"
).
innerText
=
""
;
}
function
karekok
()
{
let
sayi
=
Number
(
document
.
getElementById
(
"
sayi
"
).
value
);
let
sonuc
=
sayi
**
0.5
;
document
.
getElementById
(
"
sonuc
"
).
innerText
=
sonuc
;
document
.
getElementById
(
"
sayi
"
).
value
=
sonuc
;
}
function
temizle
()
{
sayilar
=
[];
islemler
=
[];
document
.
getElementById
(
"
sayi
"
).
value
=
""
;
document
.
getElementById
(
"
ifade
"
).
innerText
=
""
;
document
.
getElementById
(
"
sonuc
"
).
innerText
=
0
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment