Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 9

qwertyuiopasdfghjklzxcvbnmqwerty

uiopasdfghjklzxcvbnmqwertyuiopasd
fghjklzxcvbnmqwertyuiopasdfghjklzx
cvbnmqwertyuiopasdfghjklzxcvbnmq
Practica 10
wertyuiopasdfghjklzxcvbnmqwertyui
Antonio Nazaret hamabata garcia

opasdfghjklzxcvbnmqwertyuiopasdfg
6101

hjklzxcvbnmqwertyuiopasdfghjklzxc
vbnmqwertyuiopasdfghjklzxcvbnmq
wertyuiopasdfghjklzxcvbnmqwertyui
opasdfghjklzxcvbnmqwertyuiopasdfg
hjklzxcvbnmqwertyuiopasdfghjklzxc
vbnmqwertyuiopasdfghjklzxcvbnmq
wertyuiopasdfghjklzxcvbnmqwertyui
opasdfghjklzxcvbnmqwertyuiopasdfg
hjklzxcvbnmrtyuiopasdfghjklzxcvbn
mqwertyuiopasdfghjklzxcvbnmqwert
yuiopasdfghjklzxcvbnmqwertyuiopas
<html>

<head><title>Practica 12</title></head>

<body>

<h1 align="center">Potencia y condiciones</h1>

<table border="2" bgcolor="green">

<tr>

<td>

<form name="p">

valor 1:<input type="text" name="v">

potencia<input type="text" name="pot"> resultado<input type="text" name="res"> <input


type="button" name="calcular" value="calcular potencia" onClick="f()"><br><br>

<input type="submit" name="bor" value="borrar datos"></pre></tr></td></table></form>

<SCRIPT languaje="JavaScript">

function f()

var x= document.p.v.value;

var y= document.p.pot.value;

for (var x=1; x1<y; x++)

x=x*document.p.v.value;

document.p.res.value=x;

</SCRIPT>

<h1 align="center">COMPARACION CON IF<h1>


<table border="2" bgcolor="red">

<tr>

<td><form="si"><pre>

valor1<input type="text" name="v1"> valor2<input type="text" name="v2">

valor3<input type="text" name="v3"> valor4<input type="text" name="v4">

valor5<input type="text" name="v5"> valor6<input type="text" name="v6">

valor7<input type="text" name="v7"> valor8<input type="text" name="v8">

valor9<input type="text" name="v9"> valor10<input type="text" name="vl0"></td>

<td>

valor11<input type="text" name="v11" align="Left"> valor12<input type="text" name="v12">


valor13<input type="text" name="v13>

valor14<input type="text" name="v14" align="Left"> valor15<input type="text" name="v15">


valor16<input type="text" name="v16">

valor17<input type="text" name="v17" align="Left"> valor18<input type="text" name="v18">


valor19<input type="text" name="v19">

valor20<input type="text" name="v20" align="Left"> <input type="button" name="calcular"


value="comparar" OnClick="a()"> <input type="submit" name="bor" value="borrar
datos"></pre></tr></td></table></form>

<SCRIPT Languaje="JavaScript">

function a()

v 1=document.si.val1.value

v 2=document.si.val2.value

v 3=document.si.val3.value

v 4=document.si.val4.value

v 5=document.si.val5.value

v 6=document.si.val6.value

v 7=document.si.val7.value

v 8=document.si.val8.value
v 9=document.si.val9.value

v 10=document.si.val10.value

v 11=document.si.val11.value

v 12=document.si.val12.value

v 13=document.si.val13.value

v 14=document.si.val14.value

v 15=document.si.val15.value

v 16=document.si.val16.value

v 17=document.si.val17.value

v 18=document.si.val18.value

v 19=document.si.val19.value

v 20=document.si.val20.value

if(1>2)

alert("El primer valor es el mayor");

else

alert("El segundo valor es el mayor");

if(3>4)

alert("El primer valor es el mayor");

else
{

alert("El segundo valor es el mayor");

if(5>6)

alert("El primer valor es el mayor");

else

alert("El segundo valor es el mayor");

if(7>8)

alert("El primer valor es el mayor");

else

alert("El segundo valor es el mayor");

if(9>10)

alert("El primer valor es el mayor");

else
{

alert("El segundo valor es el mayor");

if(11>12)

alert("El primer valor es el mayor");

else

alert("El segundo valor es el mayor");

if(13>14)

alert("El primer valor es el mayor");

else

alert("El segundo valor es el mayor");

if(15>16)

alert("El primer valor es el mayor");

else
{

alert("El segundo valor es el mayor");

if(17>18)

alert("El primer valor es el mayor");

else

alert("El segundo valor es el mayor");

if(19>20)

alert("El primer valor es el mayor");

else

alert("El segundo valor es el mayor");

</SCRIPT>

<h1 align="center">FOR CON IF</h1>

<table border="2" bgcolor="yellow" align="left">

<tr>
<td><form="tres”><pre>

valor1<input type="text" name="v1"> valor2<input type="text" name="v2"> <input


type="button" name="comparacion" value="comparacion" OnClick="b()"> <input
type="submit" name="bor" value="borrar datos"></pre></tr></td></table></form>

<SCRIPT languaje="JavaScript">

function b()

var x= document.tres.val1.value;

var y= document.tres.val2.value;

if(x>Y)

for (var a=x;a>y;a--)

document.write(a);

else

</SCRIPT>

</body>

</html>

You might also like