home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Microsoft Programmer's Library 1.3
/
Microsoft-Programers-Library-v1.3.iso
/
sampcode
/
qc_prog
/
chap13
/
getchar.c
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
NeXTSTEP
RISC OS/Acorn
UTF-8
Wrap
C/C++ Source or Header
|
1988-04-07
|
291 b
|
13 lines
/* getchar.c -- using getchar() */
#include <stdio.h>
main()
{
int count = 1;
printf("Please enter a word.\n");
while (getchar() != '\n') /* here it is */
printf("%d.. ", count++);
printf("\n%d characters altogether\n", count - 1);
}