0% found this document useful (0 votes)
2 views1 page

JavaScript Sumatoria Calculation

The document contains JavaScript code that prompts the user for a number, uses a while loop to calculate the sum of reciprocals of squares from 1 to the input number, multiplies the sum by 6, and takes the square root of the result.

Uploaded by

Enrique
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views1 page

JavaScript Sumatoria Calculation

The document contains JavaScript code that prompts the user for a number, uses a while loop to calculate the sum of reciprocals of squares from 1 to the input number, multiplies the sum by 6, and takes the square root of the result.

Uploaded by

Enrique
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

<!

DOCTYPE html>

<html lang="en">

<head>

<meta charset="UTF-8">

<title>Document</title>

</head>

<body>

<script type="text/javascript">

var n=parseInt(prompt("Ingrese su nuemro"));

var i=1;

var t=1;

var p=1;

var sumatoria=0;

while(i<=n)

var pot=t*t;

var op=1/pot;

sumatoria=sumatoria+op;

t++;

i++;

var sumatoria_total=sumatoria*6;

var sumatoria_total1=[Link](sumatoria_total);

[Link](sumatoria_total1);

</script>

</body>

</html>

You might also like