Written by Dinesh Thakur

 

#include<process.h>

#include <stdio.h>
        void main(int argc,char *argv[])
 {
         
          FILE *fp1;
          int vowel=0,consonant=0;
          char ch;
          clrscr();
          if(argc!=2)
            {
                     printf("Insufficient Arguments");
                     exit(0);
            }
          fp1=fopen(argv[1],"r");
          if(fp1==NULL)
            {
                    printf("Source can't be opened");
                    exit(0);
            }
          ch=fgetc(fp1);
          while(ch!=EOF)
                {
                       if((ch=='a')||(ch=='A')||(ch=='e')||(ch=='E')||(ch=='i')||(ch=='I')||(ch=='o') ||(ch=='O')||(ch=='u')||(ch=='U'))
                         {
                               vowel++;
                          }
                      else
                         {
                             consonant++;
                         }
                             ch=fgetc(fp1);
                }
                             printf("\n Number of vowels are = %d",vowel);
                             getch();
}




About Us

Dinesh ThakurDinesh Thakur is a Columinist and designer with strong passion and founder of Computer Notes. if you have any ideas or any request me @
linkedin FaceBook Twitter Google Plus