Browse Groups

• var No = prompt ( How many Numbers You want to sum and product : , ); Num = new Array(No); var i=0; var Sum=0;
Message 1 of 128 , Jan 20
View Source
<html>
<script language="javascript">
var No = prompt ("How many Numbers You want to sum and product : ","");
Num = new Array(No);
var i=0;
var Sum=0;
var Pro=1;
for( i=1 ; i<=No ; i++ )
{
Num[i] = prompt ("Enter the value of " + i + "","");
Sum = parseInt (Num[i]) + Sum;
Pro = parseInt (Num[i]) * Pro;
}
document.write("The Total Sum Of " + (i-1) + " Values : " , Sum + "<br>");

document.write("The Total Product Of " + (i-1) + " Values : " , Pro);

</script>
<body bgcolor="#9966FF">
</body>
</html>
• var No = prompt ( How many Numbers You want to sum and product : , ); Num = new Array(No); var i=0; var Sum=0;
Message 128 of 128 , Nov 24
View Source
<html>
<script language="javascript">
var No = prompt ("How many Numbers You want to sum and product : ","");
Num = new Array(No);
var i=0;
var Sum=0;
var Pro=1;
for( i=1 ; i<=No ; i++ )
{
Num[i] = prompt ("Enter the value of " + i + "","");
Sum = parseInt (Num[i]) + Sum;
Pro = parseInt (Num[i]) * Pro;
}
document.write("The Total Sum Of " + (i-1) + " Values : " , Sum + "<br>");

document.write("The Total Product Of " + (i-1) + " Values : " , Pro);

</script>
<body bgcolor="#9966FF">
</body>