title: Int cannot be converted to boolean?? converting code from C to Java
body: <p>I have a code that I am converting into Java, Im new to programming but I already have done some work on both PL, although I do not understand why I get this error</p>
  
  <p>The original C code is: </p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;conio.h&gt;
  
  int main () {
      int i, j, k;
      for (i=1; i&lt;=59; i++) {
          k = 1;
          for (j=2; j&lt;i; j++)
              if (i % (j*j) == 0) k = 0;
          if (k) printf ("%d\n", i);
      }
      printf("%d",i);
      getch();
  }
  </code></pre>
  
  <p>My converted Java code:</p>
  
  <pre><code>import java.util.*;
  public class squarefree {
  
      public static void main(String[] args) {
          int i, j,k;
          for(i=1; i&lt;60; i++){
              k=1;
              for(j=2; j&lt;i; j++){
                  if(i % (j*j) == 0) 
                      k=0;
                  if(k) System.out.println(i);
              }
              System.out.println(i);
          }
      }
  }
  </code></pre>
  
  <p>Can someone please explain? Thanks guys :)</p>