Jump to content
Fórum Script Brasil
  • 0

Ajuda com javascript.


wisky2

Question

Olá, alguém poderia me ajudar?

Preciso que o codigo abaixo gere um arquivo XML com os dados que são exibidos como saida, no caso, os resultados da sequencia fibonacci.

<html>

<head><title>Fibonacci Series</title></head>

<body>

&lt;script type="text/javascript">

var va1=0, va2=1, va3;

var num = prompt("Digite o numero de ",0);

document.write(va1+"<br />");

document.write(va2+"<br />");

for(var i=3; i <= num;i++)

{

va3 = va1 + va2;

va1 = va2;

va2 = va3;

document.write(va3+"<br />");

}

</script>

</body>

</html>

alguém pode me dar uma luz, não conheço quase nada de javascript.

Att,

Wisky2

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Forum Statistics

    • Total Topics
      152.2k
    • Total Posts
      652k
×
×
  • Create New...