hAleksandrova

9.PrintTenMembersOfSequence

Sep 24th, 2012
1,372
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.65 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6. namespace PrintMembersOfSequence
  7. {
  8.     class PrintMembersOfSequence
  9.     {
  10.         static void Main()
  11.         {
  12.             Console.WriteLine("The first ten members of sequence are: ");
  13.             for (int i = 2; i <= 11; i++)
  14.             {
  15.                
  16.                 if (i % 2 == 0)
  17.                 {
  18.                     Console.Write(i+"  ");
  19.                 }
  20.                 else
  21.                 {
  22.                     Console.Write(-i+"  ");
  23.                 }
  24.                
  25.             }
  26.             Console.WriteLine();
  27.         }
  28.     }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment