You are on page 1of 1

<html>

<head>

<title>Ejemplo 11b</title>

</head>

<body>

<script type="text/javascript">

total=prompt("¿Cuántos alumnos son?");

if (total<=0 || total==null || isNaN(total)) {

document.write("hasta luego");

} else {

alumnos=new Array(total);

for(i=0;i<total;i++) {

k=i+1;

alumnos[i]=prompt("Nombre del alumno "+k);

if (alumnos[i]==null || alumnos[i]=="") { break; }

document.write("<strong>"+k+".-</strong>"+alumnos[i]+"<br>");

n=prompt("¿Qué número de alumno quieres seleccionar?");

document.write("<strong>"+n+".-</strong>"+alumnos[n-1]+"<br>");

</script>

</body>

</html>

You might also like