I am fairly new to coding in c. I am having trouble writing a function to read a character and encrypt the character so that
A becomes Z
B becomes Y
C becomes X
and so on.....
same with lowercase letters
Heres what i thought would work but i guess not. It only for capitals. I tried using ascii code but im pretty sure there is a simpler way to code this encryption process. thanks a lot.
Code:char encryptAlpha (char strChar) { // Local Definitions int i; int j; // Statements if ((strChar > 64) && (strChar < 91)) { for (i = 65, j = 90; i < 91, j > 64; i++, j--) { if (strChar == i) strChar = j; } } return strChar; }// encryptAlpha