I got it working, maybe this will help somebody else. I'll detail my reasoning, so please correct me if anything is wrong.
In my code above I had written: (plain[i]-65) + k) % 26); as a way of converting from ASCII values to the alphabetical index. This seems to be correct. Using the letter M for example with an ASCII value of 77. So, 77 - 65 = 12. And the letter M does occupy the 12th position in the alphabet (if you are indexing from 0).
Next, adding the value of k successfully rotates the character by that many positions. For example, with a key of 5, M(which is 12) becomes R(which is 17).
In my understanding the modulo function essentially means that you cannot exceed a given value. In this case, the value is 26 since there are 26 characters in the alphabet. So upon reaching 26, we have wrap around back to 0.
For example, using the letter Y with a key of 2 would result in the letter A. Since Y(24) + 2 = 26. If you are indexing from 0 as I am above this means that Z occupies index no.25, aka the 26th letter in the alphabet.
When reading other questions and answers online there seems to be some variation as to whether people are indexing from 0 or 1 for the alphabetical index. Be aware of this.
Finally, to convert back from the alphabetical index to ASCII values simply add 65(for uppercase letters) after your equation.
printf("%c", ((plain[i]-65) + k) % 26) + 65);
Using the previous letter M for example with a key of 5 this would mean (77-65) = 12) + 5 = 17) + 65) = 82 which is the ASCII value for uppercase R.