Last active
February 20, 2025 21:02
-
-
Save Zagaz/e75af5d4b28e53393277c9408ddc9351 to your computer and use it in GitHub Desktop.
Fibonacci em C# PT-BR - Por Zagaz
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| class MainClass { | |
| public static void Main (string[] args) { | |
| //E aí pessoal! Segue um programinha que faz a Sequência Fibonacci. | |
| // Um abraço!!! | |
| int numeroAnterior = 0; | |
| int numeroAtual = 1; | |
| int novoNumero; | |
| int fibonacci; | |
| for (int i = 0; i <100; i++ ) | |
| { | |
| fibonacci = numeroAnterior + numeroAtual; | |
| Console.WriteLine (fibonacci); | |
| numeroAnterior = numeroAtual; | |
| numeroAtual = fibonacci; | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Perfeito o seu código, consegui tirar a minha dúvida e desenvolver o meu.