title: Is there any difference between for loop in java and c?
body: <p><strong>for loop in c</strong></p>
  
  <pre><code>int i;
  int n = 20;
  for(i = 0; i + n; i-- ) {
       printf("-\n");
  
  }
  </code></pre>
  
  <p><strong>for loop in java</strong></p>
  
  <pre><code>int i;
  int n=20;
  for (i = 0; i + n; i--) {
     System.out.println("-\n");
  }
  </code></pre>
  
  <p>In the above example for loop in c is working fine(will print "-" 20 times).But for loop in java shows error as </p>
  
  <p><strong>Exception in thread "main" java.lang.Error: Unresolved compilation problem: 
      Type mismatch: cannot convert from int to boolean</strong></p>
  
  <p>why it shows this kind of error?</p>