Advertisement
Guest User

contadores

a guest
Sep 1st, 2015
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <script type="text/javascript">
  2.  
  3. var num1 = prompt("ingrese tu numero de inicio");
  4. var num2 = prompt("ingrese hasta que numero debe debe ir");
  5.  
  6. if ( parseInt(num1) > parseInt(num2)){
  7.     for(var i=num2; i<=num1; i++){
  8.         alert(i);
  9.  
  10.     }
  11. }
  12. else if ( parseInt(num1) < parseInt(num2)){
  13.     for(var i=num2; i>=num1; i--){
  14.         alert(i);
  15.  
  16.     }
  17.  
  18. }
  19. else{
  20.     alert("numeros iguales");
  21.  
  22.  
  23. }
  24.  
  25.  
  26. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement