Professional Documents
Culture Documents
Text1 (Lines With Upper)
Text1 (Lines With Upper)
h>
#include<conio.h>
#include<stdio.h>
int n=0;
char ch[101],reply;
fstream file;
void count()
{file.open("file.txt",ios::in);
while(!file.eof())
{file.getline(ch,101);
switch(ch[0])
{
case 'A':
case 'E':
case 'I':
case 'O':
case 'U':n++;
cout<<ch;
} }
file.close();
}
void main()
{clrscr();
file.open("file.txt",ios::out);
do
{cout<<"\nEnter a line(Max 100 characters):";
gets(ch);
file<<ch<<'\n';
cout<<"Do you wish to enter more?(y/n)";
cin>>reply;
}while(reply=='Y'||reply=='y');
file.close();
cout<<"\nLines begining with an uppercase vowel-\n\n";
count();
cout<<"\nNo. of lines begining with an uppercase vowel="<<n;
getch();
}
//OUTPUT
Enter a line(Max 100 characters):Naman Bagga is my name
Do you wish to enter more?(y/n)y
I live in India
Ubuntu 7.10 releases on 18th