Advertisement
JOHNYTHEWINNER

PrintLongSeq

May 15th, 2015
262
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.35 KB | None | 0 0
  1. using System;
  2.                    
  3. public class PrintALongSeQ
  4. {
  5.     public static void Main()
  6.     {
  7.         int i=2;
  8.         do
  9.     {
  10.     if (i%2 == 0)
  11.             {
  12.         Console.WriteLine("{0}",i);
  13.             }
  14.             else
  15.                
  16.     if (i%2 == 1)
  17.             {
  18.                 Console.WriteLine("-{0}",i);
  19.             }
  20.        
  21.                 i++;
  22.     }
  23.            
  24.             while (i<=1000);
  25.     }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement