title: How to plot a graph using my C program
body: <p>My problem is that I can't plot a graph from my c program.</p>
  
  <p>When I searched StackOverflow and google, I got this statement:</p>
  
  <p><code>system("gnuplot -p -e \"plot 'C:/Users/Ashfaaq Muhammad Dam/Desktop/New folder (3)/myfile.txt'\"");</code></p>
  
  <p>But the problem is that the terminal says <code>Gnuplot is not recognised as internal or external command.</code></p>
  
  <p><strong>//start of the program</strong></p>
  
  <pre><code> #include &lt;stdio.h&gt;
   #include &lt;conio.h&gt;\
   #include &lt;stdlib.h&gt;
  
  int main()
  {       
          int j;   
          int i;  
  
  printf("Enter how many coordinates you want to input:\n");
  scanf("%d", &amp;j);
  
  int x[j];
  int y[j];
  
   for(i=0; i&lt;j; i++)
     {      
         printf("Enter your x and y coordinate:\n");        
         scanf("%d %d", &amp;x[i], &amp;y[i]);
  
     }
  
     freopen("myfile.txt", "w", stdout);
  
     for(i=0; i&lt;j; i++)        
     {    
         printf("\n%d %d\n", x[i], y[i]);
  
     }
  system("gnuplot -p -e \"plot 'C:/Users/Ashfaaq Muhammad Dam/Desktop/New folder (3)/myfile.txt'\"");
  
  
  system("pause");
  
  return 0;
  }
  </code></pre>
  
  <p><strong>// Ending it.</strong></p>