Forum : multiply 2 number and add with 3ed number and divide by 100 and display the result on web page.
Brief description  about Online courses   join in Online courses
View Saumyajit  Chakraborty 's Profile

multiply 2 number and add with 3ed number and divide by 100 and display the result on web page.

<html>
<title>javascript</title>
<head>
<SCRIPT Language = JavaScript>

var A = 50;
var B = 10;
var C = 100;

document.write((A*B) C/100);
</SCRIPT>
</head>
</html>

The result that is displaying is wrong.This is because, there is a problem with the order of precedence .How to solve this problem....Anyone PLZ HELP
Asked by Saumyajit Chakraborty | May 13, 2010 |  Reply now
Replies (3)
View teacher siliconindia 's Profile
Hi Saumyajit ,

Write a function in head, for the above operations and then call the function in body .
Jul 14, 2010
View saumyajit chakraborty 's Profile
thnx..!!!
May 14, 2010
View manjulambigai karthikeyan 's Profile
hi ,
here u didn't add any thing." document.write( ((A*B)+ C)/100)"
it give correct ans
buy
May 14, 2010