Guest User

Untitled

a guest
Oct 22nd, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace ListaManzano03
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. //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.
  14. {
  15. int atual = 1, anterior = 0, cont = 0;
  16.  
  17. while (cont < 14)
  18. {
  19. Console.WriteLine(+ atual);
  20. atual = atual + anterior;
  21. anterior = atual - anterior;
  22. cont++;
  23. }
  24. Console.ReadKey();
  25. }
  26. }
  27. }
  28. }
Add Comment
Please, Sign In to add comment