Thread: c program that will count number of sentences in a paragraph

  1. #1
    Registered User gealon2024's Avatar
    Join Date
    Oct 2013
    Posts
    3

    c program that will count number of sentences in a paragraph

    hi. everyone ;

    can anybody help me or can give me a sample program using c language on how to count sentences in a paragraph...

  2. #2
    Registered User
    Join Date
    Jun 2005
    Posts
    6,815
    How about you put in the effort to write such a program? This is not a "give me code for free" and it is certainly not a "do my homework" site (as doing homework for people is against site policy). This is a site where you can get help if you have tried to solve your own problem (including homework) and run into a specific problem. But the prerequisite is that you provided evidence of having TRIED first.

    All you need to do is scan input and detect the beginning of a paragraph, the end of a paragraph, and the end of a sentence. At the beginning of a new paragraph, set the sentence count to zero. Each time the end of a sentence is detected, increment the count. At the end of the paragraph, write out the count.

    It is probably 10 lines of code, or less, assuming text input. Maybe 15 lines if the input is formatted in some way (say, a word document).

    You could probably write such code in less time than it took you to sign up at this site, and create your first post.
    Right 98% of the time, and don't care about the other 3%.

    If I seem grumpy or unhelpful in reply to you, or tell you you need to demonstrate more effort before you can expect help, it is likely you deserve it. Suck it up, Buttercup, and read this, this, and this before posting again.

  3. #3
    Registered User gealon2024's Avatar
    Join Date
    Oct 2013
    Posts
    3
    thanks for your advice....pardon me if take much of your time. I am a beginner to programming and making this activity is a stone for me without someone to explain
    i hope you can understand me. thank you and and have a great day.

  4. #4
    Lurking whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    9,612
    Start with reading input from the keyboard; think about what a sentence is and what you need to find in the input.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 4
    Last Post: 10-15-2012, 03:26 AM
  2. Replies: 2
    Last Post: 12-02-2011, 09:19 PM
  3. Replies: 9
    Last Post: 11-23-2011, 09:32 PM
  4. how to count the number of sentences.
    By Ray Thompson in forum C Programming
    Replies: 3
    Last Post: 11-10-2002, 10:25 AM
  5. how to count sentences and words?
    By Ray Thompson in forum C Programming
    Replies: 1
    Last Post: 11-08-2002, 01:42 PM