Question: Q2: write a program that ask user to enter the string let's say your string can be sikandar. Perform the following tasks mentioned below 1)

Q2: write a program that ask user to enter the string let's say your string can be sikandar. Perform the following tasks mentioned below 1) Print the ASCII value of each character of string. 2) 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. 3) 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. 4) Divide the string into two halves let's say "sika will be your first part and ndar will be your second part. Your task is to exchange the every second element of the input string. For example, charcter i will be exchanged to d' and 'a' will be to i. when you are done with that display the string on the console. 5) Write a function displayElement that display the element of string which is coming more than once in entire input string
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
