repo.or.cz
/
C-Programming-Examples.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Added tutotial 4-1. Function finds last char in string.
[C-Programming-Examples.git]
/
ex_1-8.c
blob
d88f5671196dd2086a9923338677574789dbdfec
1
#include <stdio.h>
2
3
main
()
4
{
5
int
c
,
nl
,
tab
,
blank
;
6
nl
=
0
;
7
tab
=
0
;
8
blank
=
0
;
9
while
((
c
=
getchar
()) !=
EOF
)
10
{
11
if
(
c
==
'
\n
'
) { ++
nl
; }
12
if
(
c
==
'
\t
'
) { ++
tab
; }
13
if
(
c
==
' '
) { ++
blank
; }
14
}
15
printf
(
"NewLines:%d
\t
Tabs:%d
\t
Blanks:%d
\n
"
,
nl
,
tab
,
blank
);
16
}