Questions


September 2021 0 45 Report
Question: Zeros At End Of Factorial Write a method Met that takes as parameter an integer n.

You have to print the number of zeros at the end of the factorial of n.

For example, 3! = 6. The number of zeros are 0. 5! = 120. The number of zeros at the end are 1.

Hint: Think about which numbers multiplication leads to a 0 at the end

Only write the method - assume that the Main class & main method have been defined.

Note: n! < 10^5

Example Input: 3
Output: 0
Example Input: 60
Output: 14
Example Input: 100
Output: 24
Example Input: 1024
Output: 253

Add an Answer


Please enter comments
Please enter your name.
Please enter the correct email address.
You must agree before submitting.

Helpful Social

Copyright © 2024 EHUB.TIPS team's - All rights reserved.