#include<fstream.h>
#include<conio.h>
void main()
{
clrscr();
ifstream fin(“STORY.TXT”);
char ch;
int i,a=0,s=0,d=0;
while(fin)
{
fin.get(ch);
i=ch;
if(i>63&&i<91||i>96&&i<123)
a++;
else
if(ch==’ ‘)
s++;
else
if(i>47&&i<58)
d++;
}
cout<<“No. OF Alphabates:”<<a;
cout<<“nNo. Of Digits:”<<d;
cout<<“nNo. Of Spaces:”<<s;
getch();
}
if a person does not have anything in the file then what should he do to perform any function on that text file.
@meenu it is necessary to insert something in the file before performing any function on that text file…….
how to do dat ??does dat mean we have to make a another ofstream function for dis??
Open the text file in notepad and manually write some data.
Good idea never taught about it Thanks a lot BRO
What does this mean/do? Cannot find any information on it.
if(i>63&&i96&&i<123)
Ascii no. Of alphabtes
I WANT THIS QUES ANS PLS……. SEND ME IN MAIL(2001abhishekp@gmail.com)
Write a program to input the name of a text file from the user and display:
a) The number of blanks present in the file.
b) The number of lines present in the file.
c) The number of capital alphabets present in the file.
d) The number of small alphabets present in the file.
e) The number of lines starting with a capital alphabet.
f) The number of words present in the file.
g) The number of digits present in the file.
h) The number of words ending with a vowel
Can you send me also?
please send me too
you are awesome man !!!!!!!!!!!!!!
Can you help me with this please?
Assume a text file “TEXT1.TXT” exist. Write a program that reads the content of this
file, and perform the following operations:-
1. Display the size of the file in bytes
2. Count and display the number of blank spaces present in the file.
3. Display a frequency table of alphabets present in the file. (Note that there are 26 alphabets and each has upper and lower case forms, e.g. Aa, Bb, Cc, Dd, … Zz.).
4. Count and display the number of words starting with a vowel letter in the file. (Note, there are 5 vowel letters and each has lower and upper case forms, i.e. Aa, Ee, Ii, Oo, Uu)
5. Count and display the number of lines present in the file.
6. Create a new file named TEXT2.TXT, which shall contain only those words from the file TEXT1.TXT that do not start with an uppercase vowel.