Looping:
Variable declarations:
int max;
for(int i=1;i<max;i++){
}
become:
int max,i=1;
for(;i<max;i++){
}
And if you have a need to or work with the i variable only once, you could start at -1 (or 0 depending on the loop circumstance) and increment inline:
int max,i=1;
for(;i<max;i++){
Console.WriteLine(i);
}
to
int max,i=1;
for(;i<max;){
Console.WriteLine(++i);
}
And that reduces by one character, and slightly obfuscates the code as well. Only do that to the FIRST i
reference, like thus: (granted one character optimizations aren't much, but they can help)
int max,i=1;
for(;i<max;i++){
Console.WriteLine(i + " " + i);
}
to
int max,i=1;
for(;i<max;){
Console.WriteLine(++i + " " + i);
}
when the loop does not have to increment i
(reverse order loop):
for(int i=MAX;--i>0;){
Console.WriteLine(i);
}