0
How to solve this question without switch case:
Input Format: A string of your message in its normal form. Output Format: A string of your message once you have encoded it (all lower case). Sample Input: Hello World Sample Output: svool dliow
9 Answers
+ 1
Just use ascii values for this
Assume you get a character c
Convert it to lowercase using tolower
('z'-97) -(c-97) +97 to get corresponding charactwr
0
what are the rules of encoding?
0
You have to enter a word than print it backwards.
For example a=z,b=y,
But without switch case
0
well, so convert first input to lower case, then get the char code of each letter wich you substract the char code of 'a' (this give you a number in range 0..25 both included), then compute 25-number (this give you the encoded range) to wich you add the char code of 'a' (this give you the char code of the encoded letter) and finally convert it to a char ^^
0
formula of YUGRAJ is valid for c/c++, for javascript you must convert char to char code before and do the result backward to a char... only for letters ^^
0
I am thinking this question long time but no idea how to solve.
Anyone can solve it.
0
Thanks brother
0
that's just the implementation of what I previously explained ^^