Skip to content

Instantly share code, notes, and snippets.

@ezesundayeze
Created June 22, 2016 23:44
Show Gist options
  • Save ezesundayeze/63b6f4d3f8f8d18269dd1c298bfe20fa to your computer and use it in GitHub Desktop.
Save ezesundayeze/63b6f4d3f8f8d18269dd1c298bfe20fa to your computer and use it in GitHub Desktop.
count serial numbers with even numbers apearing negative, while odd appears positive
using System;
public class PositiveOddNegativeEven{
public static void Main(){
for(int i=0; i<20; i++){
if(i%2==0){
Console.WriteLine(i);
}else{
Console.WriteLine("-"+i);
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment