Advertisements
Advertisements
Question
Find out error if any in following javascript code.
var length, breadth;
length=4.5;
breadth=6;
area=1/2*length*breadth;
document.write("Area of triangle is"area);
Answer in Brief
Solution
The last line should be
document.write("Area of triangle is " + area);
shaalaa.com
JavaScript Arithmetic Operators
Is there an error in this question or solution?