+ 4
1234 as abcd
If I give input as 23451 it will be convert as bcdea &it will be print in order like12345.......&abcde......
9 Answers
+ 7
What language? Your attempts?
+ 6
This is a trivial problem. Basically maintain a list of 10 characters(a-j).
Then pass the list of numbers(input) in a for loop so you can get character at index position. Which can be pushed to an array for packing the characters later.
#pseudo code
str = [a b c d e f g h i j]
inp = [4 5 7]
for i inp
res.push(str[i])
end
pack (res)
Real code:
https://code.sololearn.com/c8yjROpvHSku/
Edit: for zero based index 1 needs to be reduced from input numbers
+ 4
Sandhya What language are you using to code this?
+ 3
Hint: Every number maps to only one letter. Use relevant datatypes to help you with this associativity.
+ 3
In cpp
+ 2
Any language
+ 2
Sandhya
At least specify the language in the Relevant Tags. 'conversion' didn't help deducting your question scope.
+ 2
If we give input like 1423 it could be converted into adbc &it should be print in order like abcd
0
You could initialize an array of chars with size 26+1, 0 position will be empty, first position will contain a .... example:
array [1] = 'a';