#include <stdio.h>
#include <stdlib.h>
#include<conio.h>
void main(){
char ch;
int count=0;
FILE *fp;
clrscr();
fp = fopen("xyz.txt","r"); // read mode
if( fp == NULL )
{
printf("Error while opening the file.
");
getch();
exit(0);
}
while( 1 ){
ch = fgetc(fp);
if(ch == EOF){
break;
}
if(ch=='a' || ch=='A' || ch=='e' || ch=='E' || ch=='i' || ch=='I' || ch=='o' || ch=='O' || ch=='u' || ch=='U'){
count++;
}
}
printf(ā
Number of vowels in file : %dā,count);
fclose(fp);
getch();
}