title: How to clear screen from simple C program?
body: <pre><code>#include &lt;stdio.h&gt;
  #include &lt;cstdlib&gt;
  
  rec();
  
  main() 
  {
      int a, fact;
      char q, n, y;
      printf("\nEnter any number ");
      scanf("%d", &amp; a);
      fact = rec(a);
      printf("Factorial value = %d\n", fact);
      printf("do you want to exit.....(y/n):");
      scanf("%s" ,&amp;q);
      if (q == 'n')
      {
          system("cls");
          main();
      }
      else
          return 0;
  }
  
  rec(int x) 
  {
      int f;
      if (x == 1) 
          return 1;
      else 
          f = x * rec(x - 1);
  
      return f;
  }
  </code></pre>
  
  <p>I'm using code blocks but I don't know how to clear the screen. I searched then found <code>system("cls");</code> within header file <code>#include&lt;cstdlib&gt;</code>, but it shows the error <code>cstdlib: no such file of directory</code>. What should I do ?</p>