Re: Problem with printing input.



this reply goes to which thread ?????????

ramakrish...@xxxxxxxxx wrote:
> this program assumes that the words in a line are separated only by
one
> space.
> but writing a program that handles variable number of spaces is a
> breeze once u know the basic logic.
> Walter Roberson wrote:
> > 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

  • very rough if_sk fixes
    ... Hey all, ... I ran out and bought a Linksys EG1032 today and fixed up some of the ... witness warnings and a detach panic. ...
    (freebsd-current)
  • Re: Error when openeing word
    ... > Please respond in the newsgroups so everyone can follow along. ... >> Hey all, ... >> MYOB has been installed on this system, can anyone help me with this? ... Prev by Date: ...
    (microsoft.public.word.application.errors)
  • Re: SUMIF - 2 conditions - with references
    ... > hey thanks for your help, i converted both columns to numbers but it ... > one condition the other condition is a date, so maybe that is affecting ... > vect98's Profile: ... Prev by Date: ...
    (microsoft.public.excel.worksheet.functions)
  • Re: [OT] Stargate - To Answer Daves Question
    ... Not happy about that to be honest.....but hey, does it really matter? ... Dave ... Prev by Date: ...
    (uk.media.tv.sf.startrek)
  • Re: Bush says Cindy Sheehan is wrong
    ... Hey, when are you leaving to go search for those missing WMDs? ... Prev by Date: ...
    (rec.music.dylan)