title: why the for loop not giving factorial?
body: <p>I am using for-loop to get factorial of a number but the code is not working. Can anyone fix the error using for loop?</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;conio.h&gt;
  
  int main() {
      /*35.   Making a program to give factorial */
      int factorial = 1;
      int i = 1;
      int num;
  
      printf("Enter the number whose factorial needed");
      scanf_s("%d", &amp;num);
  
      for (i = 1; i &lt;= num; i--) {
          factorial *= i;            
          printf("%d\n", factorial);
      }
      _getch();
      return 0;
  }
  </code></pre>