## gelmi 1

if i input this numbers

12 ,24, 100
output should be

YES, YES, YES
i'm confused in writing the solution in code.

## NormR1 563

Can you post the code you are having problems with?

pseudo code:
begin loop
print "YES"
end loop

commented: sure thing. +0

## gelmi 1

``````import java.util.Scanner;

public class Divisor {
public static void main (String args[]) {
Scanner in = new Scanner(System.in);
System.out.print("Enter Number: ");
int n = in.nextInt();
int counter = 0;
for (int i = 1; i <=n; i++) {
if (n % i == 0) {
counter++;

}
System.out.println(counter);
}
}
}
``````

what is in my mind is to get the divisors then add them up. Then insert an if statement. The problem is i don't know how to add them up. :)

## NormR1 563

After the new number is obtained, add it to the variable that is to accumulate the total:
total = total + newNumber;

or shorthand way:
total += newNumber;

Can you post pseudo code for what you are trying to do? Make a list of the steps the code should take to do what you want done. Each step in the list should be as simple as possible.

commented: if i will put total += (what would i put here?) +0

## gelmi 1

hi again, how do i add the divisors?
i tried doing that it gave me answers, but wrong :) i hope you can still help me.

total += newNumber