Formatting pls, this isn't the obfuscated C contest.
Your encryption code looks fine, but your decryption is a little off as you have said. Remember, to Decrypt you need to do the exact opposite of what you have done to encrypt. This can be as simple as changing 1 operator and your target for the assignment.