Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

Варіант 6

1. Куби від 13 до 15

<html >

<head>

<script type="text/jscript">

document.write('Куби чисел від 13 до 15');

for (n=13; n<=15; n++)

s=Math.pow(n,3);

document.write('<BR>'+n+'<sup>3</sup> = '+s);

</script>

<body>

</body>

</html>

2.Скласти програму, в якій є дві картинки, що змінюються при проведенні миші

<html>

<head>

</head>

<body>

<script type="text/javascript">

function onOver(){
document.images["сонце.jpg"].src="дощ.jpg";

</script>

<img name="сонце.jpg" src="дощ.jpg" onmousedown="onOver()";

</script>

</body>

</html>

3. Знайти факторіал 5!

<html>

<head>

<meta charset="utf-8">

<script language="JavaScript">

public static int getFactorial(int f) {

if (f <= 1) {

return 5;

else {

return f * getFactorial(f - 1);

</script>

</meta>

</head>
</html>

You might also like