Second counter (j) holds the successive odd values. You terminate the loop as soon as j>10. That means you print the positive odd numbers that are less than 10: 1,3,5,7,9. That’s only 5 values.
You call i “the first counter” but its value stays at 1. It doesn’t count. What do you intend for it to do?
Your algorithm says what to do when j>10 and what to do when j<10. What should you do if j=10?
Does your assignment restrict what properties of odd numbers you’re allowed to take advantage of? For example, your algorithm takes advantage of the handy fact that successive odd numbers differ by 2. Another potentially helpful property of odd numbers is that the value of the nth odd number is (2*n)1 (for n >= 1). On the other hand, if the assignment says the only thing you are allowed to know about odd numbers is that they have a remainder of 1 when divided by 2, then you should start from 0, test the remainder, increment by 1 and repeat until you find the 10th value that passes the test.
