calculator program in javascript

technical talkiess
0

 create calculator usingf programming


<!DOCTYPE html>

<html>

<body>


<h2>My First JavaScript</h2>


<script>

const a = prompt("enter the operation like + - / *",'+');

const b = parseFloat(prompt("enter the First numbr"));

const c = parseFloat(prompt("enter the second number"));



if(a == '+'){

alert(b + c);


}

if(a == '-'){

alert(b - c);


}

if(a == '/'){

alert(b / c);


}

if(a == '*'){

alert(b * c);


}


</script>


</body>

</html> 


Post a Comment

0Comments

Thanks you for commenting your questions. I will see question and respond you.

Post a Comment (0)