Write a program that checks the string s for the values 2 3


Assume s is a string of numbers.

Write a program that checks the string s for the values '2', '3', '5' and '7'. When one of the values is found in the string, record its position within the string and continue to check for more occurrences. Finally, output the results found.

For example, if s = '568714523645873', your program should print:

2 - 7

3 - 8 14

5 - 0 6 11

7 - 3 13

Give Five (5) different examples with its output.

Solution Preview :

Prepared by a verified Expert
Management Information Sys: Write a program that checks the string s for the values 2 3
Reference No:- TGS02901237

Now Priced at $40 (50% Discount)

Recommended (95%)

Rated (4.7/5)