Question: A string is provided as input from console which consist of integer value. Insert * if subsequent numbers are even and insert '-' if subsequent

A string is provided as input from console which consist of integer value. Insert "*" if subsequent numbers are even and insert '-' if subsequent numbers are odd.

input: 21462675756 output: 214*6*2*67-5-7-56

input: 98676555533 output: 98*6765-5-5-5-5-3-3

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!