Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ListaManzano03
- {
- class Program
- {
- static void Main(string[] args)
- {
- //i) Escreva um programa que apresente a série de Fibonacci até o décimo quinto termo. A série de Fibonacci é formada pela sequência: 1, 1, 2, 3, 5, 8, 13, 21, 34, ... etc. E se caracteriza pela soma de um termo posterior com o seu anterior subsequente.
- {
- int atual = 1, anterior = 0, cont = 0;
- while (cont < 14)
- {
- Console.WriteLine(+ atual);
- atual = atual + anterior;
- anterior = atual - anterior;
- cont++;
- }
- Console.ReadKey();
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment