+ 1
How can I have multiple outputs when I input. Check the code below:
6 ответов
+ 3
As you want more than one character I would use character pointer:
https://code.sololearn.com/cIA51Wn9sZbP/?ref=app
If you know enter abd the output is 124.
+ 2
You have to use strings for that. For that you can either use array of characters or std::string for that purpose
Here I have used std::string 👇
https://code.sololearn.com/cM1Hp7oZYDf8/?ref=app
here I have used old C style strings(array of characters)👇
https://code.sololearn.com/c29jZaX4016j/?ref=app
+ 2
Oh now I understood your problem. All you need to do is type cast them to integers(as all characters are stored as their ASCII values in system) and subtract 'a' from it to get relative value from 'a'
Here👇
https://code.sololearn.com/cI8SStAIiw5S/?ref=app
+ 1
Could you reformulate your question?? I dont get what you want.... There is only one output in the code
+ 1
I want to create a program in which for example when I write the letter a I get number 1, when i write the letter b i get number 2
But the problem is if I wanted to enter those two in one input it won't give 1 and 2 it won't give anything.
How to fix rhow problem?
+ 1
Thank you for the answer everyone.