Advertisement
Guest User

Untitled

a guest
Oct 24th, 2016
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. class Program
  2. {
  3.  
  4. static int valorInserido;
  5.  
  6. static void Main(string[] args)
  7. {
  8.  
  9. Console.WriteLine("Insira um valor positivo: ");
  10. valorInserido = int.Parse(Console.ReadLine());
  11.  
  12. Console.Clear();
  13.  
  14. if (valorInserido > 0)
  15. {
  16.  
  17. for (int i = valorInserido - 1; i < 0; i--)
  18. {
  19.  
  20. if (i % 2 == 0)
  21. Console.WriteLine("{0},", i);
  22.  
  23. }
  24.  
  25. }
  26. else
  27. Console.WriteLine("Erro. Insira um valor positivo e tente novamente.");
  28.  
  29. Console.ReadKey();
  30.  
  31. }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement