I dont know how to writ this program at first:
I should write whith "function" which is definition of this function is : fk(n)
for e.g----->
10 ! =3628800 "the lowest non zero degit value" of 10 ! is "8"
12 !=479001600 "the lowest non zero degit value" of 12 ! is "6"
11 !=39916800 "the lowest non zero degit value" of 11 ! is "8"
and at last "cout" 886= 384
pleas Help me to write this ! :(

Recommended Answers

All 2 Replies

Well first off you need to write a function to compute x!. ! means factorial in math. Once you compute the factorial of the number then you need to go through each digit of the number and get the minimum digit. To do that you use the following algorithm:

min = 9;
number = factorial(x)
do
    digit = number % 10 <- this get the last digit of the number
    if digit is less than min and digit does not equal 0
        set min to equal digit
    number = number / 10 <- this drops the last digit off of the number
while number does not equal 0

and at last "cout" 886= 384

I have no idea what this means so i cant help you with that.

I would also like to point out that you have the wrong minimum for all of your answers 10! would be 2 and 11! and 12! would be 1.

hey thank u for ur answering IM so sorry but I meant this 8.8.6=384

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.