1 <script>
2
3 var tot = 0;
4 var mark = 0;
5 var avg = 0;
6
7 for(i=1; i<=5; i++)
8 {
9 Mark = prompt("Enter "+i+" mark below","");
10
11 tot = Number(tot)+Number(Mark);
12 }
13
14 avg = tot/5;
15
16 document.write("Sum is: "+tot);
17 document.write("<br>Average is: "+avg);
18
19 </script>