From da3795e0444b42684796e042e688696331973408 Mon Sep 17 00:00:00 2001 From: vasu0403 <43913217+vasu0403@users.noreply.github.com> Date: Sat, 30 Mar 2019 19:52:53 +0530 Subject: [PATCH] Update expEvaluation.js --- src/lab/exp10/simulation/expEvaluation.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/lab/exp10/simulation/expEvaluation.js b/src/lab/exp10/simulation/expEvaluation.js index ef7c4079..5f83ecbb 100644 --- a/src/lab/exp10/simulation/expEvaluation.js +++ b/src/lab/exp10/simulation/expEvaluation.js @@ -608,8 +608,17 @@ window.view = { alert('You Have Entered Wrong Expression Syntax !!!') return false } - else - return true + if(exp[3]=='%') + { + var x=document.getElementById('b').value + var y=document.getElementById('c').value + if(x-y==0) + { + alert('modulus by zero is not defined') + return false + } + } + return true }, validateLogicalExpression: function (exp) { var characterOrOperator = 0