+ 2

Write a program using java language to check whether a number is special or not by using do while loop?

a program that check a given number is special number or not by using do while loop in java language.. special number means a number which is equal to sum of its digits factorial like 145=!1+!4+!5 where !means factorial of

13th Dec 2017, 9:02 PM
mujaffar husain
mujaffar husain - avatar
7 Answers
+ 7
Here's mine. It is reasonably fast. https://code.sololearn.com/cafVdu21Gk6V/?ref=app
14th Dec 2017, 12:09 AM
Eric Blinkidu
Eric Blinkidu - avatar
0
Could you please clarify what your definition is of "special"? Thanks.
13th Dec 2017, 9:36 PM
Ryan Wakefield
Ryan Wakefield - avatar
0
a number which is equal to sum of its digits factorial like 145=!1+!4+!5 where !means factorial of
13th Dec 2017, 9:40 PM
mujaffar husain
mujaffar husain - avatar
0
So just to verify and make sure I understand this correctly. You are wanting to have a computer run through a given set of numbers to find out which ones are unique in regard to the sum of each of the digits factoraled? Just making sure to understand so that I can assist in coding.
13th Dec 2017, 9:47 PM
Ryan Wakefield
Ryan Wakefield - avatar
0
yes
13th Dec 2017, 9:48 PM
mujaffar husain
mujaffar husain - avatar
0
It all depends on how you are going to approach the problem. the first question will be what is the range of numbers you are looking to iterate through to find the special numbers? I ask as it sounds like you don't have a stopping point of how far to go before stopping your iteration.
13th Dec 2017, 10:03 PM
Ryan Wakefield
Ryan Wakefield - avatar
0
As number ļ¼ 145ļ¼Œ a(1)ļ¼ 145 / 100; b(4) ļ¼(145 / 10 ) ļ¼… 10; c(5) ļ¼ 145 ļ¼… 10; array[] ļ¼ {a, b, c}; Just making two loops of code block怂
14th Dec 2017, 11:42 AM
zihua