Computer Science, asked by muhil04, 4 months ago


Given two integer numbers input1
and input2, find the total number of occurrences of input 1 in a
series of natural numbers from 0 till input2.

Note:
1. input1 will be within 1 - 9 and
1. input2 will be within 1 - 100.​

Answers

Answered by pawarparasaram09
32

Answer:

Input : 22 Output : 6 Explanation: Total 2s that appear as digit from 0 to 22 are (2, 12, 20, 21, 22); Input : 100 Output : 20 Explanation: total 2's comes between 0 to 100 are (2, 12, 20, 21, 22..29, 32, 42, 52, 62, 72, 82, 92);

Explanation:

please mark as brainleast and give like and follow me

Answered by dayanait1003
0

Answer:

Input1 =2

Input2 =20

output = 3

Similar questions