The error message means that you need to invoke volteado
and siprimo
on an instance of the Program
class. E.g.:
...
Program p = new Program();
long av = p.volteado(a); // av is "a" but swapped
if (p.siprimo(a) == false && p.siprimo(av) == false)
...
They cannot be invoked directly from the Main
method because Main
is static while volteado
and siprimo
are not.
The easiest way to fix this is to make the volteado
and siprimo
methods static:
private static bool siprimo(long a)
{
...
}
private static bool volteado(long a)
{
...
}