So i watched zamaylas walkthrough and noticed the formula she showed with is quite clever but i have absolutely no idea how to tell the program that A = 0 and Z = 25 as well as a = 0 and z = 25... do i use a for loop before the main one ... or what? i have no idea what to do please help... U won't need my code for this but here it is anyway

printf("Please enter the plaintext\n");
string p = GetString();

for(int i = 0, n = strlen(p); i < n; i++){
            int u = p[i] + k;
            printf("%c", u);
    else if(isspace(p[i])){
        printf(" ");

1 Answer 1


You have to use the asciimath to get the alphabetical index. Just do calculation to get alphabetical index of A that is 0, when you have asciivalue of A that is 65.

  • I get that the formula would be character - 65.. but how do i tell my program that Jun 15, 2016 at 18:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .