Like Tree2Likes
  • 2 Post By grumpy

c program that will count number of sentences in a paragraph

This is a discussion on c program that will count number of sentences in a paragraph within the C++ Programming forums, part of the General Programming Boards category; hi. everyone ; can anybody help me or can give me a sample program using c language on how to ...

  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,261
    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.
    Salem and Sebastiani like this.
    Right 98% of the time, and don't care about the other 3%.

  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
    Registered User whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    7,667
    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, 08:19 PM
  3. Replies: 9
    Last Post: 11-23-2011, 08:32 PM
  4. how to count the number of sentences.
    By Ray Thompson in forum C Programming
    Replies: 3
    Last Post: 11-10-2002, 09:25 AM
  5. how to count sentences and words?
    By Ray Thompson in forum C Programming
    Replies: 1
    Last Post: 11-08-2002, 12:42 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21