elenat82
11/6/2015 - 10:21 AM

il costrutto while in JavaScript.html

<!DOCTYPE html>
<html>
<head>
	<title>Il costrutto while in JavaScript</title>
	<script type="text/javascript">
	var primo = 0;
	var secondo = 1;
	var indice = 0;
	document.write("<p>" + primo + "</p>");
	document.write("<p>" + secondo + "</p>");
	while (indice <8) {
		terzo = secondo + primo;
		document.write("<p>" + terzo + "</p>");
		primo = secondo;
		secondo = terzo;
		indice++;
	}
	</script>
</head>
<body>

</body>
</html>