Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- //Write a program that prints the first 10 members of the sequence: 2, -3, 4, -5, 6, -7, ...
- class PrintSequence
- {
- static void Main()
- {
- for (int i = 2; i < 13; i++)
- {
- if (i % 2 != 0)
- {
- Console.Write("{0}, ", i * (-1));
- }
- else
- {
- Console.Write("{0}, ", i);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement