forked from Ayush-chhabra/Hacktoberfest
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathF11.CPP
More file actions
56 lines (53 loc) · 1.04 KB
/
F11.CPP
File metadata and controls
56 lines (53 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#include<conio.h>
#include<fstream.h>
#include<stdio.h>
#include<string.h>
#include<ctype.h>
void main()
{
clrscr();
char ch[70];
ofstream fout;
fout.open("count.txt",ios::in);
{
cout<<"Enter Data: ";
cin.getline(ch,70);
fout<<ch;
}
fout.close();
int c=1,n=0,w=1;
ifstream fin;
fin.open("count.txt",ios::out);
{
fin.getline(ch,70);
for(int i=0;ch[i]!='\0';i++)
{
if(isdigit(ch[i]))
{ ++n;}
else if(ch[i]=='a'||ch[i]=='A'||ch[i]=='e'||ch[i]=='E'
||ch[i]=='i'||ch[i]=='I'||ch[i]=='o'||ch[i]=='O'||ch[i]=='u'||ch[i]=='U')
{ ++c; }
else if(ch[i]==' ')
{
++w;
}
}
cout<<"\nNo. of words: "<<w
<<"\nNo. of Vowels: "<<c
<<"\nNo of Numbers: "<<n;
fin.close();
}
ofstream nile;
nile.open("counter.txt",ios::out);
{
for(int i=0;ch[i]!='\0';i++)
{ if(ch[i]==' ')
{
ch[i]='#';
}
nile<<ch[i];
}
nile.close();
}
getch();
}