Quote:How I write a code to know prime number by if
Short answer: you don't, because it is impossible. Loops and ifs are two different beast for different usage. It is like trying to flt with a car instead of a plane.
There is no possible advice other than 'study Java, follow tutorials'.