title: How can I call notepad.exe from a C program?
body: <p>i have written a time table program in c</p>
  
  <pre><code>#include&lt;stdio.h&gt; 
  #include&lt;conio.h&gt; 
  void main()
  {
    int i=0;
    int selection;
    char day[20];
    char sub1[20];
    char sub2[20];
    char sub3[20];
    FILE *fp;
    fp=fopen("aa.txt","w");
    textcolor(5);
    textbackground(3);
    clrscr();
    while(i&lt;3)
    {
      printf("Enter the day ");
      scanf("%s",day);
      printf("Enter the period 12.30-1:30 ");
      scanf("%s",sub1);
      printf("Enter the period 1.35-2.40 ");
      scanf("%s",sub2);
      printf("Enter the period 2.45-3.50 ");
      scanf("%s",sub3);
      fprintf(fp,"\n %s TIMETABLE IS AS FOLLOWS\n",day);
      fprintf(fp,"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n");
      fprintf(fp,"|~~~~~~~~~|~~~~~~~~~~~~~~~|~~~~~~~~~~~~~~|~~~~~~~~~~|\n");
      fprintf(fp,"| TIME    | 12.30-1.30    | 1.35-2.40    |2.45-3.50 |\n");
      fprintf(fp,"|~~~~~~~~~|~~~~~~~~~~~~~~~|~~~~~~~~~~~~~~|~~~~~~~~~~|\n");
      fprintf(fp,"| SUBJECT *     %s     * %s  * %s|\n",sub1,sub2,sub3);
      fprintf(fp,"|~~~~~~~~~|~~~~~~~~~~~~~~~|~~~~~~~~~~~~~~|~~~~~~~~~~|\n");
      i++;
    }
    printf(" Time table has been Created in the File aa.txt successfully");
    getch();
  }
  </code></pre>
  
  <p>when i finish the timetable . the time table is created in a.txt file. i want that file to be opened and show me automatically in a notepad. how to program that in c?</p>