Rotaing the string

there is a problem to rotate the string like if k=3 and string is “codingblocks” the the output will be “ckscodingblo”
check plz tell me whats wrong in my code-
code link-https://ide.codingblocks.com/s/122432

@shubhamshagy Your logic is wrong. You are shifting characters to right first and then moving the character from i-k to i-1 to initial positions which is wrong. See if you first shift charcters to right, the last k characters would be lost and overwritten. That is why there is no cks in your generated output. Dry run your code for some sample cases and check where it fails.

the same logic was used in video ,only difference is that i took string instead of char.