+ 1
Please How do u write a code that Prints 100 members of the sequence 2, -3, 4, -5, 6, -7, 8 in C#.
I know it's using for loop, but don't know the right syntax to use
3 Antworten
+ 8
Run a loop from 2 to n, and you can use % operator to decide - sign
print(n%2!=0 ? "-" : "")
+ 2
you can use 2 loops one that prints the even number and the other that add -2 to that with <50 condition