Divisors of a natural number: Difference between revisions

m
→‎{{header|Java}}: if you mix spaces and tabulations for indentation, please do it correctly :p
m (→‎{{header|Java}}: if you mix spaces and tabulations for indentation, please do it correctly :p)
Line 140:
for(int i = 1; i < a; i = i+1)
{
if (a % i == 0)
{
System.out.print(i + ",");
}
}
System.out.print((int)a);
System.out.println("]");
}
}
 
public static void main(String args[])
{
for(int x = 1; x <= 16; x = x+1)
{
ans(Math.pow(2, x-1));
}
ans(Math.pow(2, 31-1));
}
}
}</lang>
</lang>
{{out}}
<pre>divisors of 1 = [1]