-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSM1.C
49 lines (48 loc) · 1020 Bytes
/
SM1.C
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
#include<stdio.h>
#include<conio.h>
#define CAV toupper(c)
void main()
{
char c;
int nc=0,nl=1,nw=1,nv=0;
clrscr();
gotoxy(2,2);
textcolor(LIGHTRED);
cprintf(" terminate the text with CTRL+Z.. hit enter ");
gotoxy(5,5);
while((c=getchar())!=EOF)
{
if(c=='\n' || c=='.')
{
nl++;
nc--;
}
if(toupper(c)=='A' || toupper(c)=='E' || toupper(c)=='I' || toupper(c)=='O' || toupper(c)=='U')
{
nv++;
}
if(c==' ' || c=='\t')
{
nw++;
nc=nc+0;
}
else
nc++;
}
textbackground(BLACK);
textcolor(CYAN);
gotoxy(15,20);
cprintf(" the number of characters in the above input are: %d",nc);
textcolor(RED );
gotoxy(15,21);
cprintf(" the number of lines in the above input are : %d ",nl);
textcolor(MAGENTA);
gotoxy(15,22);
cprintf(" the number of words in the above input are : %d ",nw);
textcolor(YELLOW);
gotoxy(15,23);
cprintf(" the number of vovels in the above input are : %d ",nv);
textcolor(WHITE);
fflush(stdin);
while(!kbhit());
}