Jan

23

#include<stdio.h>

#include<conio.h>

void main(){

char ch;char fname[100];

FILE *fp;int count=0;

printf(“\n Enter File name from read data: “);

gets(fname);

fp=fopen(fname,”r”);

printf(“\n\n The content of the text file is: \n\n”);

while(!feof(fp)){

ch=getc(fp);

switch(ch){

case ‘a’:

case ‘A’:

case ‘e’:

case ‘E’:

case ‘i’:

case ‘I’:

case ‘o’:

case ‘O’:

case ‘u’:

case ‘U’:

count++;

}

printf(“%c”,ch);

}

printf(“\n\n count=%d “,count);

fclose(fp);

}


Leave a Reply