1.

Please answer me this javascript question. Need answer to part (2) Don't make irrelevant comments please.

Answer» BLEM is solved using JavaScript.                 JavaScript.                                                                          
S.No.NUMBER.Factorial.
           <‎script‎>         function factorial(a){            if(a==1)               return 1;            return a*factorial(a-1);         }         var a=parseInt(prompt("Please ENTER first number: "));         var b=parseInt(prompt("Please enter second number: "));         var c=1;         for(var i=a;i<=b;i++,c++){            var r= document.getElementById("tt").insertRow(i-a+1);            var c1 = r.insertCell(0);            var c2 = r.insertCell(1);            var c3 = r.insertCell(2);            c1.innerHTML = c;            c2.innerHTML = i;            c3.innerHTML = factorial(i);         }      <‎/‎‎script‎‎>   By default, a table is created with 1 ROW and 3 columns, containing S.No, Number and Factorial. Now we have inserted a new row and new columns. Inside the columns, we have filled the required DATA using innerHTML property. Hence, the problem is solved.See attachment for output.


Discussion

No Comment Found