I have an exercise to do the four basic operations, but multiplication / division is not going, and you have to test if the number q is dividing is not zero. But sum and subtraction is right.
<html>
<head>
<title> Primeiro Projeto</title>
<meta charset="utf-8">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script><scripttype="text/javascript">
function calcSoma(){
var a=$("#num1").val();
var b=$("#num2").val();
var c= parseInt(a)+parseInt(b);
$("#num3").val(c);
}
function calcSub(){
var a=$("#num1").val();
var b=$("#num2").val();
var c= parseInt(a)-parseInt(b);
$("#num3").val(c);
}
function calcDiv(){
var a=$("num1").val();
var b=$("num2").val();
if(b != "0"){
var c= parseInt(a)/parseInt(b);
$("#num3").val(c);
}else{
$("#num3").val("Dividendo é 0");
}
}
function calcMult(){
var a=$("num1").val();
var b=$("num2").val();
var c= parseFloat(a)*parseFloat(b);
$("#num3").val(c);
}
</script>
</head>
<body>
Número1: <input type="text" size="2px" id="num1"><br>
Número2: <input type="text" size="2px" id="num2"><br>
<button onclick="calcSoma()">+</button>
<button onclick="calcSub()">-</button>
<button onclick="calcDiv()">/</button>
<button onclick="calcMult()">*</button><br>
Resultado:<input type="text" size="2px" id="num3">
</body>
</html>