Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script type="text/javascript">
- var num1 = prompt("ingrese tu numero de inicio");
- var num2 = prompt("ingrese hasta que numero debe debe ir");
- if ( parseInt(num1) > parseInt(num2)){
- for(var i=num2; i<=num1; i++){
- alert(i);
- }
- }
- else if ( parseInt(num1) < parseInt(num2)){
- for(var i=num2; i>=num1; i--){
- alert(i);
- }
- }
- else{
- alert("numeros iguales");
- }
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement