Thursday, 15 August 2013

html - <PRE> TAG doesn't work? -


Here, what I am doing is wrapping my "java" code like this in a "pre" tag. Has been:

<> pre & lt; Pre & gt; Var sum = function (toSum) {var j = 0; (Var i = 0; i & lt; to.Sum.length; i ++) {j = j + tosum [i]; } Console.log ("sum of the array" + j); }; Yoga ([1,2,3,4]); Var Multiply = Function (Toumupplei) {var j = 1; (Var i = 0; i & lt; tomultiply.length; i ++) for {j = j * truppleplet [i]; } Console.log ("Multiples of array" + j); }; Multiplication ([1,2,3,4]); & Lt; / Pre & gt;

But what I am actually receiving is:

  var sum = function (toSum) {var j = 0;       "post-text" itemprop = "text"> 

you & lt; Instead of & amp; Lt; should use , & amp; Gt; & gt; and & amp; Amp; & amp; for In HTML when displaying

For your loop:

 for  (var i = 0; i & amp; lt; to.Sum.length; i ++) {.. .}  

No comments:

Post a Comment