MCPcopy Create free account
hub / github.com/PrajaktaSathe/Java / checkLucky

Method checkLucky

Programs/LuckyNumber.java:9–22  ·  view source on GitHub ↗
(int n)

Source from the content-addressed store, hash-verified

7
8 //Method to check if the number is a Lucky Number
9 public boolean checkLucky(int n)
10 {
11 if(c > n)
12 return true;
13 if(n % c == 0)
14 return false;
15
16 //Position of the element
17 n = n - (n/c);
18
19 //Incrementing the counter variable
20 c++;
21 return checkLucky(n);
22 }
23
24 //Main method
25 public static void main(String[] args)

Callers 1

mainMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected