w3_Prompt example



Given 2 numbers, A and B, One needs to find their sum. The required output is one integer.
f(a,b) = a+b
f(2,3) = 5

Pas2JS pascal source code
var a := StrToIntDef(w3_Prompt('A+B', 'Enter 1st number'),0); var b := StrToIntDef(w3_Prompt('A+B', 'Enter 2nd number'),0); WriteLn('Sum is '+IntToStr(a+b));