Program that converts a number to a letter of the alphabet
C++ does not mandate a particular character coding, so while your code is functionally correct on ASCII and ISO-8859 systems, it won't work in EBCDIC environments, for example.  Even with the obvious fix to add 'A'-1 in place of the magic constant 64, the program assumes that English letters have consecutive values, which just isn't the case in BCD encodings.

The portable approach is to index a string literal:

    static const std::string_view alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";

    if (letter &gt; 0 &amp;&amp; letter &lt;= alphabet.size()) {
        std::cout &lt;&lt; "Letter " &lt;&lt; letter &lt;&lt; " is '"
                  &lt;&lt; alphabet[letter-1]
                  &lt;&lt; "'\n";
    }




Other issues:


Don't use letter before checking whether std::cin &gt;&gt; letter succeeded.
Instead of an infinite loop, prefer a finite loop for reading inputs.
Consider accepting input as command-line argument(s) as a more convenient alternative to using standard input.
Spelling: "corresponds".