Question 12

Write a method that takes in a positive integer, return the number of 2s between 0 and the input number.

If the input value given is 13, it should return 2 as the number 2 and 12 are between 0 and 13.

If the input value given is 21, it should return 3 as the number 2,12 and 20 are between 0 and 21.

[advanced_iframe securitykey=”undefined” src=”” width=”100%” height=”600″]

KodNest Training New Batch is starting on 02nd November 2020. Attend one week free demo classes.Register Now

New Report