This isn't exactly an answer to the question that you asked, but I like the coding convention where you always use braces. This makes it easy. It's a "no-brainer" to always type braces for loops and such.
When ever compiler sees int j=10; internally it breaks it into int j; j=10; thats why when there is no braces around int j=10; it got declared with in for loop and lost its scope outside the loop. Hence we get compiler error for accessing an uninitialized variable.