Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!--
- De utilizat o funcție JS în zona HEAD. Se citesc 2 numere naturale de la tastatură.
- Să se afișeze CMMDC al celor 2 numere utilizînd algoritmul lui Euclid. -->
- <html>
- <head>
- <meta charset = "UTF-8" />
- <script type = 'text/javascript'>
- function cmmdc(x, y) {
- if (y == 0)
- { return m.p.value = x; }
- else
- { return cmmdc(y, x % y); }
- }
- </script>
- </head>
- <body>
- <h1><font color = red>Să se afișeze CMMDC: </font></h1>
- <form name='m'>
- <p><b>x = </b><input type=text name='x'></input> <br>
- <b>y = </b><input type=text name='y'></input> <br>
- <br>
- CMMDC = <input type=text name='p'></input></p> <br>
- <input type=button value='CMMDC' onClick='cmmdc(m.x.value, m.y.value)'></p>
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement