for(int i=a;i<10 && j != 10;i++)
It seems like the above code will compile but I'm not sure if it will accomplish what you want. I've never thought about putting a complex condition there.
If all else fails, what you had in the first place is completely valid.