Created
August 13, 2017 20:21
-
-
Save Zagaz/af2a64561bd4688896c4d5156555de4f to your computer and use it in GitHub Desktop.
Fibonacci created by Zagaz - https://repl.it/KFk4/26
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) { | |
| int numeroAnterior = 0; | |
| int numeroAtual = 1; | |
| int novoNumero; | |
| int fibonacci; | |
| for (int i = 0; i <20; 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