write a program that forms a new sentence on taking an input string as per the below algorithm
Answers
Answered by
0
Write a program that forms a new sentence by taking an input string as per the below algorithm the alphabet should be N number of times in forwarding mode.
To Find:
A program that satisfies all the mentioned conditions.
Solution:
Here, the question states to take an input string and then take a value by which it will move forward in alphabet series while progressing.
This is the code in c++,
In this program, in the string S, "abc" is taken as a string the first letter of which will get shifted to 2, i.e,
"a" will become "c"
Now the new string becomes, "cbc" which will move by 5. i.e,
"cb" will get converted into "hg"
Now the new string becomes, "hgc" which will move by 9. i.e,
"hgc" will get converted into "qpl"
So, the output of the above program will become "qpl".
#SPJ1
Attachments:
Similar questions