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.
if (some_check) {
if (some_other_check) {
while (more input) {
}
}
}
if (some_check) {
if (some_other_check) {
while (more input) {
}
}
}
Further, to make your code more readable, leave one blank space between operators.
x = a + b * 3;
x=a+b*3;