lmarkov

The first 10 members of sequence

Nov 19th, 2012
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.38 KB | None | 0 0
  1. using System;
  2.  
  3. class MembersOfSequence
  4. {
  5.     static void Main()
  6.     {
  7.         int membersCount = 10;
  8.         int i;
  9.  
  10.         Console.WriteLine("The first " + membersCount + " members of the sequence are:");
  11.  
  12.         for (i = 1; i <= membersCount; i++)
  13.         {            
  14.             Console.WriteLine(i + ". " + (i + 1) * Math.Pow((-1), (i + 1)));
  15.         }
  16.        
  17.     }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment