Tuesday, September 20, 2011

WAP to store vowels from one file to another


/*
  Name: WAP to store vowels from one file to another
  Author: Parveen Malik
  Date: 20/09/11 08:45
*/


#include <stdio.h>
#include <conio.h>


void main()  
 {  
 char c;  
 FILE *f,*f1;  
 f=fopen("STRING","w");   
 printf("Enter String :\n ");  
 while(scanf("%c",&c)!=EOF)  
 putw(c,f);  
 fclose(f);  
 f=fopen("STRING","r");  
 f1=fopen("VOWELS","w");  
 while((c=getw(f))!=EOF)  
 if((c=='a')||(c=='e')||(c=='i')||(c=='o')||(c=='u')||(c=='A')||(c=='E')||(c=='I')||(c=='O')||(c=='U'))  
 putw(c,f1);  
 fclose(f);  
 fclose(f1);  
 f1=fopen("VOWELS","r");  
 printf("\nVOWELS : \n");  
 while((c=getw(f1))!=EOF)  
 printf(" %c",c);  
 getch();  
 }


OUTPUT : 



0 comments:

Post a Comment