English

Find out error if any in following javascript code. - Information Technology

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?
Chapter 3: Impressive Web Designing - Exercise [Page 57]

APPEARS IN

Balbharati Information Technology (IT) [English] 11 Standard Maharashtra State Board
Chapter 3 Impressive Web Designing
Exercise | Q 6 | Page 57
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×