Code:
#include <stdio.h>
#define EOF -1
main()
{
int count,letter;
system("pwd");
count=0;
letter= getchar();
while(letter!= EOF)
{
if(letter=='e')
++count;
letter=getchar();
}
printf("frequency %d\n",count);
}
this program counts the number of 'e's on a text i saved under a text file.I want to know how i can open that file. the program name is com1 and the file name is file1.
com1<file1 doesn't work
Last edited by a moderator: