tag:blogger.com,1999:blog-7953476913268941048.post1508479578149245598..comments2024-02-07T08:19:10.374-08:00Comments on Programming Tutorials: Write a C Program to Count Number of Words in a Sentence By Taking Input From UserUnknownnoreply@blogger.comBlogger6125tag:blogger.com,1999:blog-7953476913268941048.post-30761046849612922822015-09-11T10:25:40.299-07:002015-09-11T10:25:40.299-07:00Check this out!! Here's also a problem for fir...Check this out!! Here's also a problem for first line's words count but resolved newline problem :) <br /><br />#include <br />#include <br /><br />int words(const char sentence[ ])<br />{<br /> int counted = 0; // result<br /><br /> // state:<br /> const char* it = sentence;<br /> int inword = 0;<br /><br /> do switch(*it) {<br /> case '\0':<br /> sadiqur_rahmanhttps://www.blogger.com/profile/15598584026068145982noreply@blogger.comtag:blogger.com,1999:blog-7953476913268941048.post-28637730838979058042015-07-16T11:01:04.364-07:002015-07-16T11:01:04.364-07:00How do you resolve the issue without complexing th...How do you resolve the issue without complexing the program when the input sentence starts with a blank space?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-7953476913268941048.post-1503000174130219962015-02-21T19:12:42.031-08:002015-02-21T19:12:42.031-08:00Thanks. Solve the issue of word count when consecu...Thanks. Solve the issue of word count when consecutive spaces are there.Programming Tutorialhttps://www.blogger.com/profile/06415123639935228733noreply@blogger.comtag:blogger.com,1999:blog-7953476913268941048.post-44833115860571597732015-02-21T04:00:56.309-08:002015-02-21T04:00:56.309-08:00if consecutive spaces found the words are count wi...if consecutive spaces found the words are count without a word .......<br />check it and give a new solution.......Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-7953476913268941048.post-66346507288959754372014-09-12T08:19:53.774-07:002014-09-12T08:19:53.774-07:00Thanks for pointing error, i have corrected it.Thanks for pointing error, i have corrected it.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-7953476913268941048.post-70227542555751213972014-09-09T06:36:06.939-07:002014-09-09T06:36:06.939-07:00If we dont give any input in your program, i.e., j...If we dont give any input in your program, i.e., just press enter... The number of words will be counted as 1 not 0. Is there any way to resolve this bug?Anonymousnoreply@blogger.com