The following program demonstrates your tab width, indentation style, and various other aspects of your code style. Please write it (in verbatim) in your preferred style. Remember to use spaces instead of tabs, as shitchan automatically converts tabs into 3 space characters.
[code]#include "stdio.h"
int main (void)
{ int x;
char c = 'a';
float y = 0;
for (x = 0; x < 10; x++)
{ if (x % 2 == 0)
printf ("%d\n", x);
else
{ printf ("%c\n", c);
c +=1;
}
}
When it comes to C-likes, here's what I think of them:
K&R - okay, if consistent, but I find it less readable
Allman - more readable, I tend to find it easier to parse
BSD - okay, but less readable than Allman, however I like how function return type is declared on a separate line
Whitesmith - I don't see any advantage to it.
GNU - It's not terrible, but the braces having their own indent level is just plain weird.
Horstmann - Pretty good. Combines Allman's advantages with K&R's advantages. Probably one of the better ones, but it requires a good editor like Emacs to be used with. Is this what OP used?
For C-likes, I tend to use Allman, but if I'd use a more superior editor like Emacs for C code, I'd write in Horstmann style.
Indentation style is an already fully solved problem for some languages, for example Lisp has its own style, which is used by all sane Lispers (it's actually hard to read code written in non-standard lisp indentation styles, which are usually nonexistent and only used by misguided newbies which don't have a good editor). Emacs (and other lisp editors) provide full (re)indentation support and paren-matching, as well as many other useful features. This is ideal, but it helps having an uniform syntax, which is not what C-likes have.