https://ide.codingblocks.com/s/367477
why it is repeating some numbers when we are using k=i+2 in the loop
https://ide.codingblocks.com/s/367477
why it is repeating some numbers when we are using k=i+2 in the loop
Check your updated code
Now it’s not showing repetitive values 
can u explain me the reason behind this .
Yes sure, actually with your j , you were doing j=I+1 , which is good
With your k, you were doing I+2, instead you should have done k=j+1. That’s why you were getting duplicate values.
ok.but on submiting the above code its not passing any test cases why. 
It’s because of the output format. In line number 25 add an extra space before first comma
See this https://ide.codingblocks.com/s/367481