Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class PrintSequence
- {
- static void Main()
- {
- for (int i = 2; i <= 11; i++)
- if (i % 2 == 0)
- {
- if (i == 2) //This "if" will remove the comma before the first number.
- Console.Write(i);
- else
- Console.Write("," + i);
- }
- else
- Console.Write("," + (-i));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement