Hi,
Can someone help me with the following error? Please help.
Main.java:14: error: class Divisor is public, should be declared in a file named Divisor.java
public class Divisor {
^
1 error
My code is:
-
@author Muneeb
*/
public class Divisor {/**
-
@param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
Scanner c = new Scanner (System.in);
int num = c.nextInt();
int max = 1;
for (int i = 1; i <= num; i++) {
if (num % i == 0 && i <= 10 && i > max) {
max = i;
}
}
System.out.println(max);
}
-
@param args the command line arguments
}
Regards.