It's not at all necessary, but I find it makes much easier to read code if you instead only use if statements and just return early when you're in a function. For example, you could check isalpha(letter) == true is true then check letter + key <= 90 do the letter += key; return letter; then since letter + key must be > 90 if it didn't already return a value, then you can do the while statement and return letter without needing an if statement at all. Then the isalpha(letter) == false is also unncessary, just return letter at the end.
Like this:
char rotate(char letter, int key)
{
if (isalpha(letter)
{
if (letter + key <= 90)
{
letter += key;
return letter;
}
do the while loop here
}
return letter;
}