+ 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
7 Answers
+ 7
Here's mine. It is reasonably fast.
https://code.sololearn.com/cafVdu21Gk6V/?ref=app
0
Could you please clarify what your definition is of "special"? Thanks.
0
a number which is equal to sum of its digits factorial like 145=!1+!4+!5 where !means factorial of
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.
0
yes
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.
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ć