Re: Problem with printing input.



In article <1114061152.442467.165550@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
<ramakrishnat@xxxxxxxxx> wrote:
>try execute this program ...

>#include <stdio.h>

>/* print the input one word per time on different lines */

>int main(void)
>{
> int c;
> while ((c = getchar()) != EOF) {
> if (c == ' ' || c == '\n' || c == '\t')
> putchar('\n');
> else
> putchar(c);
> }
> return 0;
>}

And if the input is

hey you rama krishna

is your program going to print one word per line?
--
"Never install telephone wiring during a lightning storm." -- Linksys
.



Relevant Pages