Advertisement
ivelin_m

PrintSequence

Mar 9th, 2014
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. using System;
  2.  
  3. class PrintSequence
  4. {
  5. static void Main()
  6. {
  7. Console.WriteLine("The first ten members of sequence are: ");
  8. for(int i=2;i<=11;i++)
  9. {
  10. if(i%2==0)
  11. {
  12. Console.WriteLine(i);
  13. }
  14. else
  15. {
  16. Console.WriteLine(-i);
  17. }
  18. }
  19. Console.WriteLine();
  20. }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement