Indentation
Use consistent indentation (typically 2 spaces). If the indenting level is more than 4 or 5 levels you may think about factoring out code.
Good
if (some_check) {
if (some_other_check) {
while (more input) {
}
}
}
Bad
if (some_check) {
if (some_other_check) {
while (more input) {
}
}
}
Further, to make your code more readable, leave one blank space between operators.
Good
x = a + b * 3;
Bad
x=a+b*3;