Last active
November 30, 2022 06:30
-
-
Save Brianceasar/76a7f696d9f4523626783186375748d4 to your computer and use it in GitHub Desktop.
Program that prints the first 100 members of the sequence 2, -3, 4, -5, 6, -7, 8...
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for (int i = 2; i < 101; i++) | |
{ | |
if (i % 2 == 0) | |
{ | |
Console.Write("{0} ", i); | |
} | |
else | |
{ | |
Console.Write("{0} ", -i); | |
} | |
} | |
Console.WriteLine(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment