I'm trying to solve the Caesar problem.

if you look at my code, I tried to iterate through the "plaintext" value with a for loop. My aim was at every alphabetical character to apply the chypher formula and then printing the new value converted as character.

However, if I attempt to do that, I receive nothing. I tried by switching %c to %i in the latter printf statement and it actually converts but that's not the aim of the exercise :). I'm linking my code below.

Furthermore, as the code is still in progress if you have any other hints for correctly passing the Pset, I would be very glad to hear from you.




Simply put, your code is producing non-printable characters. If you'd like to see the value that is being calculated, try printing the letters out as %i integers.

The code is applying the modulo technique directly to the letter, meaning that it is being applied to the ASCII numeric value that represents the letter. The modulo conversion can only be applied to a numeric representation of the number between 0 and 25 inclusive.

If this answers your question, please click on the check mark to accept. Let's keep up on forum maintenance. ;-)

  • Hi and thanks for replying. You gave me a precious hint and managed to figure it out by myself. the code seems to work now and work per specicification. However, it is not able to pass the test. If you could check the code and suggest modifications, I would be very glad to hear from you. gist.github.com/0a5aff109eed07b46041113a7db24251 – Alessio Novi Apr 6 '17 at 15:38
  • I managed to solve the issue. Thank you anyway. – Alessio Novi Apr 8 '17 at 17:31

You must log in to answer this question.

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