Duplicate character formatting

star is printed extra at end please rectify code

hello basant ,
here is your working code link - https://ide.codingblocks.com/s/172583
there was a small error in your code at line number 15
there j should go till n-2 because u r comparing j with j+1
i hope this resolve ur doubt if so please mark it resolved.
regards
Aman yadav