0
Encryption : Rotate 3
i want to transform a letter from the alphabet to another one ( that other one is the letter who's after the first letter by 3) e.g. letter 'a' becomes 'd' and 'b' becomes 'e'... i do have an idea for how to do this but instead of the letter being transformed to the letter i only get the ascii code of that number... any help will be appreciated!
3 Respostas
+ 1
because probably u r not casting .
suppose ur character is 'a' then u should weite simply
'a' +3 for d but here u r doing one mistake.
as 3 is int whole expression will get coverted to ascii /int value of d.
to make it character again typecast it like (char)('a'+3)
+ 1
thanks mate it worked :)
+ 1
bro i dont know c#😞
but i suggest u one thing
write -
(char)(ch+(3+ch-'a' )%26 );
this one line will shorten ur code