<meta charset="utf-8"> <script> var a = parseInt(prompt("Введите первое число:")); var b = parseInt(prompt("Введите второе второе число:")); alert(a+b); var c = parseInt(prompt("Отними:")) alert("Результат="+(a+b)-с); </script> 

Guys, why don't I have a line with the answer?

    2 answers 2

    Because 'c' in the string "var c" and 'c' in the string "(a + b) -c);" various.
    One 'c' code 99 - ENG
    The other 'c' code 1089 - РУС


    To get the answer you need to add parentheses ((a + b) - c) .

     <script> var a = parseInt(prompt("Введите первое число:")); var b = parseInt(prompt("Введите второе второе число:")); alert(a + b); var c = parseInt(prompt("Отними:")) alert("Результат=" + ((a + b) - c)); </script> 
    • corrected, but now instead of the answer with numbers, the line NaN appeared - polin
    • @polin "instead of the answer with numbers, the string NaN appeared" - you need to add brackets. added in reply - Stack
    • after adding the bracket, everything stopped working at all - polin
    • @polin "after adding brackets, everything stopped working at all" - you need two brackets. before а and after c . try to just copy the code from my answer and run. - Stack

    Not ; at the end var c = parseInt (prompt ("Take away:"))