Question: Q2: write a program that ask user to enter the string lets say your string can be sikandar. Perform the following tasks mentioned below Print
Q2: write a program that ask user to enter the string lets say your string can be sikandar. Perform the following tasks mentioned below
- Print the ASCII value of each character of string.
- Write a function encode that encode the input string and display the encoded string on the console. You can encode the input string by extracting the ASCII value of each character and add integer value 2 in it in each character.
- Write a function decode that decode the input string by subtracting value 2 from each character of the input string. Display the original string on the console.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
