February 2019 0 22 Report
Na podstawie podanego skryptu w javascript napisz program ktory: podaje liczbe 0-liczby parzyste 1-liczby nieparzyste i podaje liczby parzyste lub nieparzyste z zakresu 1-100

<html>
<head>
</head>
<body>
<script type="text/javascript">

var x=parseInt(prompt("Podaj ile wierszy:"));
var y=0; suma=0;
document.write("<table border=\"2\">");
for(i=1; i<x; i++)
{
y = parseInt(prompt("Podaj "+i+" liczbe"));

if(!y){y=0;}
document.write("<tr><td>"+i+"</td><td width=\"200\">"+y+"</td></tr>");
suma = y+suma;
}
document.write("<tr><td>suma:</td><td width=\"200\">"+suma+
"</td></tr>");
document.write("<tr><td>srednia:</td><td width=\"200\">"+suma/x+
"</td></tr>");
document.write("</table>");
</script>
</body>
</html>


More Questions From This User See All

Recommend Questions



Life Enjoy

" Life is not a problem to be solved but a reality to be experienced! "

Get in touch

Social

© Copyright 2013 - 2024 KUDO.TIPS - All rights reserved.