| var assignment = (function () { function assignment() { } assignment.prototype.operator = function (a, b) { var c; c = a + b; document.writeln("Addtion Operation Result: " + c + "<br>"); c += a; document.writeln("Assignment Operation AND Add Result:" + c + "<br>"); c -= a; document.writeln("Assignment Operation AND Subtract Result:" + c + "<br>"); c *= a; document.writeln("Assignment Operation AND Multiply Result:" + c + "<br>"); c /= a; document.writeln("Assignment Operation AND Division:" + c + "<br>"); c %= a; document.writeln("Assignment Operation AND Modulus:" + c + "<br>"); }; return assignment; })(); window.onload = function () { var a; var b; a = parseInt(prompt("Enter A First Number")); b = parseInt(prompt("Enter A Second Number")); var greeter = new assignment(); document.write("First Number is :" + a + "<br>"); document.write("Second Number is :" + b + "<br>"); greeter.operator(a, b); }; |