title: calculate the sum of all the digits of number till you get a single digit in java script r give idea to improve below program
body: <pre><code>while(no&gt;0) {
   sum=sum+no%10;
   no=Math.floor(no/10);
   }
   alert("Sum of digits "+sum);
  </code></pre>