Masking – 2 Write a program that reads a single line of input and prints the first two and last two characters of the given input and prints the asterisk character (*) in place of the remaining characters. Explanation For example, if the given string is message, then the first two and last two characters are me, ge. Now replacing all the remaining characters with * will give the output me***ge. Sample Input 1 message Sample Output 1 me***ge Sample Input 2 12345 Sample Output 2 12*45

Masking – 2

Write a program that reads a single line of input and prints the first two and last two characters of the given input and prints the asterisk character (*) in place of the remaining characters.

Explanation

For example, if the given string is

message, then the first two and last two characters are me, ge. Now replacing all the remaining characters with * will give the output me***ge.

Sample Input 1
message
Sample Output 1
me***ge
Sample Input 2
12345
Sample Output 2
12*45

Don't hesitate - Save time and Excel

Are you overwhelmed by an intense schedule and facing difficulties completing this assignment? We at GrandHomework know how to assist students in the most effective and cheap way possible. To be sure of this, place an order and enjoy the best grades that you deserve!

Post Homework
Top