Now i want to modify the above code so that it encrypts the dststr using Caesar cipher method and which of course will be printed out on the screen aswell.
Thanks for ur reply and i hope it makes the point clear if not feel free to ask me.
Br.
A caesar encryption is just a replacement encryption.
Couple of ways to go about this but I only have time to explain two
One is the simpliest you have two strings
ABCDEFGHI
WLPQSRNXZ
You take each char from the source string and find it's equiv in the top string and use that index to find it's equiv in the encryption key there at the bottom.
An faster way would be to setup your encryption key as the previous one for the first 9 characters...
WLPQSRNXZ
Now I find a character in my source string the first character happens to be an 'A' I check a mask to see if it's upper case or lower case and then depending on that outcome I subtract 'A' from it for upper case characters and 'a' from it for lower case characters.
What's this give me? An offset sir 'A' - 'A' is 0 and a 0 offset into our above string is 'W'
'B' - 'A' is 1 so a 1 offset.