Computer Science, asked by dikshajadhav51, 9 months ago

i will mark you brainliest plz answer my question . Write a program to encrypt the word by 2 characters e.x. computer output is epqrwvgt

Answers

Answered by AdaPetruccelli
3

Answer:

Input :s=”abcda”, x=3

Output :dyzad

‘a’ appear 2 times in the string, hence incrementing ‘a’ by 3 becomes ‘d’

‘b’ appear 1 times in the string, hence decrementing ‘b’ by 3 becomes ‘y’

‘c’ appear 1 times in the string, hence decrementing ‘c’ by 3 becomes ‘z’

‘d’ appear 1 times in the string, hence decrementing ‘d’ by 3 becomes ‘a’

‘a’ appear 2 times in the string, hence incrementing ‘a’ by 3 becomes ‘d’

Hence the string becomes “dyzad”

Input :s=”aabbc”, x=5

Output :ffggx

Answered by pratibhabhanugpblwkd
0

Answer:

Input: str = "abcd"

Output: bdee

Explanation:

a -> a + 1 -> b

b -> b + 2 -> d

c -> c + 2 -> e

d -> d + 1 -> e

Input: str = "xyz"

Output: yaa

Explanation:

x -> x + 1 -> y

y -> y + 2 -> a

z -> z + 1 -> a

Similar questions