title: Error Showing in (int i=n;i&gt;0;i--)
body: <p>I tried to write code for an factorial number program,following code </p>
  
  <pre><code>public class Factorial {
      public static void main(String[] args) {
          Scanner in = new Scanner(System. in );
  
  
          System.out.println("Enter the number whose factorial you want: ");
  
          int n = in .nextInt();
          int f = 1;
          for (int i = n; i &amp; gt; 0; i--) //error show what's wrong in for loop {
              f = f * i;
          }
          System.out.println("Factorial of " + n + " is " + f);
    }
  }
  </code></pre>