<html> <head> <script> function sum10() { var count = 0 var sum= 0 while(count<10) { var n = +prompt("Enter number") if(n>0) { count = count + 1 sum = sum + n } } var avg=sum/10 var result = document.getElementById("result") result.innerHTML = "Total = " + sum +"avg ="+avg } </script> </head> <body> <input type="button" value="Go" onclick="sum10()"/> <div id="result"> sum=0, avg=0 </div> </body> </html>
Plot No. 64, PU-4, Scheme 54, Behind C21 Mall near Hotel Holiday , AB Road, Indore Pin-code:452001
contact@codebetter.in
+91 88230 75444, +91 99939 28766