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=”https://code.kodnest.com/” width=”100%” height=”600″]

Register for the new batch at KodNest and start your journey to success.Secure Your Spot Now!Claim Your Seat

Request A Callback

Get a Free 30-minute Counseling session with our experts.