Ejercicio 12 - IF (practica del 3er TP)


/ Published in: JavaScript
Save to your folder(s)



Copy this code and paste it in your HTML
  1. <script>
  2. var n1;
  3. var n2;
  4. var n3;
  5.  
  6. n1=Number(prompt('Ingrese 1er NUMERO',''));
  7. n2=Number(prompt('Ingrese 2do NUMERO',''));
  8. n3=Number(prompt('Ingrese 3er NUMERO',''));
  9.  
  10. if(n1>n2 && n1>n3){
  11. if(n2>n3){
  12. document.write(n1+','+n2+','+n3);
  13. }else{
  14. document.write(n1+','+n3+','+n2);
  15. }
  16. }
  17. if(n2>n1 && n2>n3){
  18. if(n1>n3){
  19. document.write(n2+','+n1+','+n3);
  20. }else{
  21. document.write(n2+','+n3+','+n1);
  22. }
  23. }
  24. if(n3>n1 && n3>n2){
  25. if(n1>n2){
  26. document.write(n3+','+n1+','+n2);
  27. }else{
  28. document.write(n3+','+n2+','+n1);
  29. }
  30. }
  31.  
  32.  
  33.  
  34.  
  35. </script>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.