Skip to content

Instantly share code, notes, and snippets.

@Zagaz
Created August 13, 2017 20:21
Show Gist options
  • Save Zagaz/af2a64561bd4688896c4d5156555de4f to your computer and use it in GitHub Desktop.
Save Zagaz/af2a64561bd4688896c4d5156555de4f to your computer and use it in GitHub Desktop.
Fibonacci created by Zagaz - https://repl.it/KFk4/26
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