영상
개념
<script>
/*
[개념] 함수 응용 계산기
*/
function plus(x , y) {
let c = x + y
document.write(c + "<br>");
}
function minus(x , y) {
let c = x - y
document.write(c + "<br>");
}
function multiply(x , y) {
let c = x * y
document.write(c + "<br>");
}
function division(x , y) {
let c = x / y
document.write(c.toFixed(2) + "<br>");
}
plus(10, 3);
minus(10, 3);
multiply(10, 3);
division(10, 3);
</script>
Java
복사