Computer Science, asked by deepikasatishshah, 3 months ago

The
function displays characters based on the ASCII value.
Trim
Value
Text
Char​

Answers

Answered by coolistictrailer
1

Answer:

Given a string str consisting of lowercase letters only and an integer k, the task is to replace every character of the given string by character whose ASCII value is k times more than it. If ASCII value exceeds ‘z’, then start checking from ‘a’ in a cyclic manner.

Examples:

Input: str = “abc”, k = 2

Output: cde

a is moved by 2 times which results in character c

b is moved by 2 times which results in character d

c is moved by 2 times which results in character e

Input: str = “abc”, k = 28

Output: cde

a is moved 25 times, z is reached. Then 26th character will be a, 27-th b and 28-th c.

b is moved 24 times, z is reached. 28-th is d.

b is moved 23 times, z is reached. 28-th is e.

Explanation:

oof my hand hurts typing

hope this helps

Similar questions