This is what i intend to do:
Ask the user to enter any string, encrypt it with rot13(shift character 13 places).
All characters are permitted.
After every fifth character, change key to rot7.
Decrypt text, print both encrypted and decrypted on screen.
I think you are doing two separate things wrong (possibly three - see the comment at the bottom).
Firstly, you are testing that the 'character' is divisible by 5, not its position. So your lines 23 and 35 should both start if (i % 5 == 0) ...
Secondly, you are encoding and decoding every 5th character TWICE (because you have already done ROT13 on everything). If that wasn't intended, you should use an
if ... else if
construct here; say
1 2
if (i % 5 == 0) ...code for ROT7;
else ... code for ROT13;
Get this to work and check your encryption by hand.
I'm assuming that 'ROT13' simply means translating by 13 and not cycling back to the start of the alphabet when you get to 'z' or 'Z', say. You should check this with your assessor, because ROT could be standing for ROTATION.