Program to create a data file and count the vowels in the file.



/*To create a data file and count the vowels in the file.*/

#include

main()
{
FILE *fp;
char ch; int v=0; clrscr();
fb=fopen("text.dat","w");
printf("\nInput text to write into file \n");
while((ch=getc(stdin))!+EOF)
{
putc(ch,fp);
switch(ch)
{
case 'a':
case 'e':
case 'i':
case 'o':
case 'u':
v++;
}
}
printf("\nTotal vowels are %d",v);
fclose(fp);
}

1 comment:

  1. it was good but it does n't giving the question
    which am asked

    ReplyDelete