I'm doing this for a class, but I'm having a bit of a problem which after I input the 5 digits in the compiler, it will only play nnnnn instead of what I'm looking for.
This is what is requested: Using a while loop, generate the password in a new string variable by reversing the order of the character in the string and subtracting 15 from each character to produce the password.
I'm doing this for a class, but I'm having a bit of a problem which after I input the 5 digits in the compiler, it will only play nnnnn instead of what I'm looking for.
From ASCII table, digits and alphabet characters are different. You should treat them differently.
Digits have lower values comparing to alphabet characters, so it is not good that you directly subtract the characters directly with 15.
I've only given it a quick look but on line 32 the subscript for a[] is going out of bounds. I would assume you intended something more like line 31 b[i] = (a[I] - 15);