VelizarAvramov

PrintSequence

Mar 22nd, 2017
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.42 KB | None | 0 0
  1. using System;
  2.  
  3.     class PrintSequence
  4.     {
  5.         static void Main()
  6.         {
  7.             for (int i = 2; i < 12; i++ )
  8.             {
  9.                 if (i % 2 ==0)
  10.                 {
  11.                     Console.Write("{0},", i);
  12.                 }
  13.                 else
  14.                 {
  15.                     Console.Write("{0},",-i);
  16.                 }
  17.             }
  18.             Console.WriteLine();
  19.         }
  20.     }
Advertisement
Add Comment
Please, Sign In to add comment