Advertisement
Guest User

Untitled

a guest
Feb 8th, 2016
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. <!--
  2. De utilizat o funcție JS în zona HEAD. Se citesc 2 numere naturale de la tastatură.
  3. Să se afișeze CMMDC al celor 2 numere utilizînd algoritmul lui Euclid. -->
  4.  
  5.  
  6. <html>
  7. <head>
  8. <meta charset = "UTF-8" />
  9. <script type = 'text/javascript'>
  10. function cmmdc(x, y) {
  11. if (y == 0)
  12. { return m.p.value = x; }
  13. else
  14. { return cmmdc(y, x % y); }
  15. }
  16. </script>
  17. </head>
  18.  
  19. <body>
  20. <h1><font color = red>Să se afișeze CMMDC: </font></h1>
  21. <form name='m'>
  22. <p><b>x = </b><input type=text name='x'></input> <br>
  23. <b>y = </b><input type=text name='y'></input> <br>
  24. <br>
  25. CMMDC = <input type=text name='p'></input></p> <br>
  26. <input type=button value='CMMDC' onClick='cmmdc(m.x.value, m.y.value)'></p>
  27. </form>
  28. </body>
  29.  
  30. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement