gdata.io.handleScriptLoaded({"version":"1.0","encoding":"UTF-8","feed":{"xmlns":"http://www.w3.org/2005/Atom","xmlns$openSearch":"http://a9.com/-/spec/opensearchrss/1.0/","xmlns$gd":"http://schemas.google.com/g/2005","xmlns$georss":"http://www.georss.org/georss","xmlns$thr":"http://purl.org/syndication/thread/1.0","xmlns$blogger":"http://schemas.google.com/blogger/2008","id":{"$t":"tag:blogger.com,1999:blog-5735018943946871385"},"updated":{"$t":"2023-12-09T13:35:10.032-08:00"},"category":[{"term":"Hackerrank Delete duplicate-value nodes from a sorted linked list Solution"},{"term":"Hackerrank Print the elements of a linked list solution"},{"term":"PATTERNS"},{"term":"pattern generation in c"},{"term":"c++ program"},{"term":"Hackerrank Reverse a doubly linked list solution"},{"term":"programming"},{"term":"TEXT ANALYZER"},{"term":"networks"},{"term":"triangle pattern c++"},{"term":"unipolar encoding simulation"},{"term":"Hackerrank Print in Reverse solution"},{"term":"c++"},{"term":"education"},{"term":"opps sandclock pattern"},{"term":"opps triangle pattern"},{"term":"Linked Lists in C++"},{"term":"coding"},{"term":"C++ Diamond Pattern"},{"term":"hourglass pattern c++"},{"term":"hackerrank"},{"term":"java"},{"term":"c"},{"term":"Utopian tree"},{"term":"lexical analyser"},{"term":"cpp"},{"term":"Hackerrank Insert a node into a sorted doubly linked list Solution"},{"term":"java program"},{"term":"mini project"},{"term":"c programming"},{"term":"operator precedence"}],"title":{"type":"text","$t":"GRK"},"subtitle":{"type":"html","$t":"A blog by Gokul Raj Kumar"},"link":[{"rel":"http://schemas.google.com/g/2005#feed","type":"application/atom+xml","href":"https://www.blogger.com/feeds/5735018943946871385/posts/default/-/c?alt\u003djson-in-script\u0026max-results\u003d6"},{"rel":"self","type":"application/atom+xml","href":"https://www.blogger.com/feeds/5735018943946871385/posts/default/-/c?alt\u003djson-in-script\u0026max-results\u003d6"},{"rel":"alternate","type":"text/html","href":"http://blog.grkweb.com/search/label/c"},{"rel":"hub","href":"http://pubsubhubbub.appspot.com/"}],"author":[{"name":{"$t":"GRK"},"uri":{"$t":"https://www.blogger.com/profile/00099219911209322075"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"35","height":"35","src":"//www.blogger.com/img/blogger_logo_round_35.png"}}],"generator":{"version":"7.00","uri":"https://www.blogger.com","$t":"Blogger"},"openSearch$totalResults":{"$t":"4"},"openSearch$startIndex":{"$t":"1"},"openSearch$itemsPerPage":{"$t":"6"},"entry":[{"id":{"$t":"tag:blogger.com,1999:blog-5735018943946871385.post-2178678384943778319"},"published":{"$t":"2014-09-23T09:46:00.003-07:00"},"updated":{"$t":"2022-01-16T20:38:16.592-08:00"},"category":[{"scheme":"http://www.blogger.com/atom/ns#","term":"c programming"},{"scheme":"http://www.blogger.com/atom/ns#","term":"Utopian tree"},{"scheme":"http://www.blogger.com/atom/ns#","term":"c"},{"scheme":"http://www.blogger.com/atom/ns#","term":"hackerrank"}],"title":{"type":"text","$t":"Utopian Tree"},"content":{"type":"html","$t":"\u003cdiv dir\u003d\"ltr\" style\u003d\"text-align: left;\" trbidi\u003d\"on\"\u003e\n\u003cbr /\u003e\n\u003cdiv class\u003d\"msB\" style\u003d\"background-color: white; border: 0px; color: #39424e; font-family: \u0026quot;Whitney SSm A\u0026quot;, \u0026quot;Whitney SSm B\u0026quot;, verdana, \u0026quot;Lucida Grande\u0026quot;, sans-serif; font-size: 16px; font-stretch: inherit; line-height: 22.4px; margin: 0px 0px 10px; outline: 0px; overflow-wrap: break-word; padding: 0px; vertical-align: baseline; word-break: break-word; word-wrap: break-word;\"\u003e\n\u003cdiv style\u003d\"border: 0px; font-size: 18px; font-stretch: inherit; font-style: inherit; font-variant: inherit; line-height: 1.5em; margin-bottom: 1em; outline: 0px; overflow-wrap: break-word; padding: 0px; vertical-align: baseline; word-break: break-word; word-wrap: break-word;\"\u003e\n\u003cstrong style\u003d\"border: 0px; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; outline: 0px; overflow-wrap: break-word; padding: 0px; vertical-align: baseline; word-break: break-word; word-wrap: break-word;\"\u003eProblem Statement\u003c/strong\u003e\u003c/div\u003e\n\u003c/div\u003e\n\u003cdiv class\u003d\"msB\" style\u003d\"background-color: white; border: 0px; color: #39424e; font-family: \u0026quot;Whitney SSm A\u0026quot;, \u0026quot;Whitney SSm B\u0026quot;, verdana, \u0026quot;Lucida Grande\u0026quot;, sans-serif; font-size: 16px; font-stretch: inherit; line-height: 22.4px; margin: 0px 0px 10px; outline: 0px; overflow-wrap: break-word; padding: 0px; vertical-align: baseline; word-break: break-word; word-wrap: break-word;\"\u003e\n\u003cdiv style\u003d\"border: 0px; font-size: 18px; font-stretch: inherit; font-style: inherit; font-variant: inherit; line-height: 1.5em; margin-bottom: 1em; outline: 0px; overflow-wrap: break-word; padding: 0px; vertical-align: baseline; word-break: break-word; word-wrap: break-word;\"\u003e\nThe Utopian Tree goes through 2 cycles of growth every year. The first growth cycle occurs during the spring, when it doubles in height. The second growth cycle occurs during the summer, when its height increases by 1 meter.\u0026nbsp;\u003cbr style\u003d\"overflow-wrap: break-word; word-break: break-word; word-wrap: break-word;\" /\u003eNow, a new Utopian Tree sapling is planted at the onset of spring. Its height is 1 meter. Can you find the height of the tree after\u0026nbsp;\u003cspan class\u003d\"MathJax_Preview\" style\u003d\"border: 0px; color: #888888; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; outline: 0px; overflow-wrap: break-word; padding: 0px; vertical-align: baseline; word-break: break-word; word-wrap: break-word;\"\u003e\u003c/span\u003e\u003cspan aria-readonly\u003d\"true\" class\u003d\"MathJax\" id\u003d\"MathJax-Element-1-Frame\" role\u003d\"textbox\" style\u003d\"border: 0px; direction: ltr; display: inline; float: none; font-family: inherit; font-stretch: inherit; font-variant: inherit; line-height: normal; margin: 0px; max-height: none; max-width: none; min-height: 0px; min-width: 0px; outline: 0px; overflow-wrap: normal; padding: 0px; vertical-align: baseline; white-space: nowrap; word-break: break-word; word-spacing: normal; word-wrap: normal;\"\u003e\u003cnobr style\u003d\"-webkit-transition: none; border: 0px; margin: 0px; max-height: none; max-width: none; min-height: 0px; min-width: 0px; padding: 0px; transition: none; vertical-align: 0px; word-break: break-word; word-wrap: break-word;\"\u003e\u003cspan class\u003d\"math\" id\u003d\"MathJax-Span-1\" style\u003d\"-webkit-transition: none; border: 0px; display: inline-block; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; position: static; transition: none; vertical-align: 0px; width: 1.131em; word-break: break-word; word-wrap: break-word;\"\u003e\u003cspan style\u003d\"-webkit-transition: none; border: 0px; display: inline-block; font-family: inherit; font-size: 22.1399993896484px; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; height: 0px; margin: 0px; outline: 0px; padding: 0px; position: relative; transition: none; vertical-align: 0px; width: 0.906em; word-break: break-word; word-wrap: break-word;\"\u003e\u003cspan style\u003d\"-webkit-transition: none; border: 0px; clip: rect(1.673em 1000.002em 2.622em -0.359em); font-family: inherit; font-size: 22.1399993896484px; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; left: 0.002em; margin: 0px; outline: 0px; padding: 0px; position: absolute; top: -2.482em; transition: none; vertical-align: 0px; word-break: break-word; word-wrap: break-word;\"\u003e\u003cspan class\u003d\"mrow\" id\u003d\"MathJax-Span-2\" style\u003d\"-webkit-transition: none; border: 0px; display: inline; font-family: inherit; font-size: 22.1399993896484px; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; position: static; transition: none; vertical-align: 0px; word-break: break-word; word-wrap: break-word;\"\u003e\u003cspan class\u003d\"mi\" id\u003d\"MathJax-Span-3\" style\u003d\"-webkit-transition: none; border: 0px; display: inline; font-family: MathJax_Math-italic; font-size: 22.1399993896484px; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; position: static; transition: none; vertical-align: 0px; word-break: break-word; word-wrap: break-word;\"\u003eN\u003cspan style\u003d\"-webkit-transition: none; border: 0px; display: inline-block; font-family: inherit; font-size: 22.1399993896484px; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; height: 1px; margin: 0px; outline: 0px; overflow: hidden; padding: 0px; position: static; transition: none; vertical-align: 0px; width: 0.093em; word-break: break-word; word-wrap: break-word;\"\u003e\u003c/span\u003e\u003c/span\u003e\u003c/span\u003e\u003cspan style\u003d\"-webkit-transition: none; border: 0px; display: inline-block; font-family: inherit; font-size: 22.1399993896484px; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; height: 2.486em; margin: 0px; outline: 0px; padding: 0px; position: static; transition: none; vertical-align: 0px; width: 0px; word-break: break-word; word-wrap: break-word;\"\u003e\u003c/span\u003e\u003c/span\u003e\u003c/span\u003e\u003cspan style\u003d\"-webkit-transition: none; border-left-style: solid; border-width: 0px 0px 0px 0.003em; display: inline-block; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; height: 0.947em; margin: 0px; outline: 0px; overflow: hidden; padding: 0px; position: static; transition: none; vertical-align: -0.053em; width: 0px; word-break: break-word; word-wrap: break-word;\"\u003e\u003c/span\u003e\u003c/span\u003e\u003c/nobr\u003e\u003c/span\u003e\u0026nbsp;growth cycles?\u003c/div\u003e\n\u003c/div\u003e\n\u003ch3 style\u003d\"text-align: left;\"\u003e\nSOURCE CODE:\u003c/h3\u003e\n\u003cpre style\u003d\"background-image: URL(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif); background: rgb(240, 240, 240); border: 1px dashed rgb(204, 204, 204); color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;\"\u003e\u003ccode style\u003d\"color: black; overflow-wrap: normal; word-wrap: normal;\"\u003e #include\u0026lt;stdio.h\u0026gt;  \n void main()  \n {  \n   int t,test,total;  \n   scanf(\"%d\",\u0026amp;test);  \n   while(test--){  \n     scanf(\"%d\",\u0026amp;t);  \n     total\u003d1;  \n     int flag\u003d1;  \n     while(t--)  \n     {  \n       if(flag){  \n         if(total\u003d\u003d1){  \n           total+\u003d1;  \n         }else{  \n         total*\u003d2;  \n         }  \n       flag--;  \n       }  \n       else{  \n         total+\u003d1;  \n         flag++;  \n       }  \n     }  \n     printf(\"%d\\n\",total);  \n   }  \n }   \n\u003c/code\u003e\u003c/pre\u003e\n\u003cbr /\u003e\u003c/div\u003e\n"},"link":[{"rel":"replies","type":"application/atom+xml","href":"https://blog.grkweb.com/feeds/2178678384943778319/comments/default","title":"Post Comments"},{"rel":"replies","type":"text/html","href":"https://blog.grkweb.com/2014/09/utopian-tree.html#comment-form","title":"4 Comments"},{"rel":"edit","type":"application/atom+xml","href":"https://www.blogger.com/feeds/5735018943946871385/posts/default/2178678384943778319"},{"rel":"self","type":"application/atom+xml","href":"https://www.blogger.com/feeds/5735018943946871385/posts/default/2178678384943778319"},{"rel":"alternate","type":"text/html","href":"https://blog.grkweb.com/2014/09/utopian-tree.html","title":"Utopian Tree"}],"author":[{"name":{"$t":"GRK"},"uri":{"$t":"https://www.blogger.com/profile/00099219911209322075"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"35","height":"35","src":"//www.blogger.com/img/blogger_logo_round_35.png"}}],"thr$total":{"$t":"4"}},{"id":{"$t":"tag:blogger.com,1999:blog-5735018943946871385.post-1894594100708550161"},"published":{"$t":"2014-07-11T12:18:00.001-07:00"},"updated":{"$t":"2014-07-11T12:45:43.483-07:00"},"category":[{"scheme":"http://www.blogger.com/atom/ns#","term":"c programming"},{"scheme":"http://www.blogger.com/atom/ns#","term":"programming"},{"scheme":"http://www.blogger.com/atom/ns#","term":"c"},{"scheme":"http://www.blogger.com/atom/ns#","term":"operator precedence"}],"title":{"type":"text","$t":"Operator Precedence"},"content":{"type":"html","$t":"\u003cdiv dir\u003d\"ltr\" style\u003d\"text-align: left;\" trbidi\u003d\"on\"\u003e\n\u003cdiv dir\u003d\"ltr\" style\u003d\"text-align: left;\" trbidi\u003d\"on\"\u003e\nSimple program for operator precedence parser in C.\u003cbr /\u003e\nIt takes the expression as input and calculates the precedence of the operators.\u003cbr /\u003e\n\u003cbr /\u003e\nSubscribe to the blog to get instant updates via E-Mail.\u003cbr /\u003e\n\u003ch2 style\u003d\"text-align: left;\"\u003e\nPROGRAM CODE:\u003c/h2\u003e\n\u003cbr /\u003e\n\u003cpre style\u003d\"background-image: URL(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;\"\u003e\u003ccode style\u003d\"color: black; word-wrap: normal;\"\u003e #include\u0026lt;stdio.h\u0026gt;  \n #include\u0026lt;string.h\u0026gt;  \n void main()  \n {  \n   int i,j,cnt\u003d1;  \n   char operators[] \u003d\"*/%+-\",input[100];  \n   printf(\"Enter the statement : \");  \n   gets(input);  \n   for(i\u003d0;i\u0026lt;strlen(operators);i++)  \n   {  \n     for(j\u003d0;j\u0026lt;strlen(input);j++)  \n     {  \n       if(input[j]\u003d\u003doperators[i])  \n       {  \n         printf(\"%d %c\u003d%c%c%c\\n\",cnt++,input[j-1],input[j-1],input[j],input[j+1]);  \n         input[j+1]\u003dinput[j-1];  \n       }  \n     }  \n   }  \n }  \n\u003c/code\u003e\u003c/pre\u003e\n\u003c/div\u003e\n\u003cbr /\u003e\n\u003ch2 style\u003d\"text-align: left;\"\u003e\nOUTPUT:\u003c/h2\u003e\n\u003cbr /\u003e\n\u003cdiv class\u003d\"separator\" style\u003d\"clear: both; text-align: center;\"\u003e\n\u003ca href\u003d\"http://3.bp.blogspot.com/-ms0kOoiSOgM/U8A4KdjDyYI/AAAAAAAAAiI/YhDfxMkwj54/s1600/UntitledS.png\" imageanchor\u003d\"1\" style\u003d\"margin-left: 1em; margin-right: 1em;\"\u003e\u003cimg border\u003d\"0\" src\u003d\"http://3.bp.blogspot.com/-ms0kOoiSOgM/U8A4KdjDyYI/AAAAAAAAAiI/YhDfxMkwj54/s1600/UntitledS.png\" height\u003d\"321\" width\u003d\"640\" /\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cbr /\u003e\nSubscribe to the blog to get instant updates via E-Mail.\u003cbr /\u003e\n\u003cbr /\u003e\n\u003cspan style\u003d\"background-color: white; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 18px; line-height: 25.200000762939453px;\"\u003eNotify the Suggestions about the program through comments ... :)\u003c/span\u003e\u003c/div\u003e\n"},"link":[{"rel":"replies","type":"application/atom+xml","href":"https://blog.grkweb.com/feeds/1894594100708550161/comments/default","title":"Post Comments"},{"rel":"replies","type":"text/html","href":"https://blog.grkweb.com/2014/07/operator-precedence.html#comment-form","title":"0 Comments"},{"rel":"edit","type":"application/atom+xml","href":"https://www.blogger.com/feeds/5735018943946871385/posts/default/1894594100708550161"},{"rel":"self","type":"application/atom+xml","href":"https://www.blogger.com/feeds/5735018943946871385/posts/default/1894594100708550161"},{"rel":"alternate","type":"text/html","href":"https://blog.grkweb.com/2014/07/operator-precedence.html","title":"Operator Precedence"}],"author":[{"name":{"$t":"GRK"},"uri":{"$t":"https://www.blogger.com/profile/00099219911209322075"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"35","height":"35","src":"//www.blogger.com/img/blogger_logo_round_35.png"}}],"media$thumbnail":{"xmlns$media":"http://search.yahoo.com/mrss/","url":"http://3.bp.blogspot.com/-ms0kOoiSOgM/U8A4KdjDyYI/AAAAAAAAAiI/YhDfxMkwj54/s72-c/UntitledS.png","height":"72","width":"72"},"thr$total":{"$t":"0"}},{"id":{"$t":"tag:blogger.com,1999:blog-5735018943946871385.post-8039109526893003507"},"published":{"$t":"2014-07-06T01:39:00.001-07:00"},"updated":{"$t":"2014-07-06T01:39:04.796-07:00"},"category":[{"scheme":"http://www.blogger.com/atom/ns#","term":"c programming"},{"scheme":"http://www.blogger.com/atom/ns#","term":"c"},{"scheme":"http://www.blogger.com/atom/ns#","term":"lexical analyser"}],"title":{"type":"text","$t":"Lexical Analyzer"},"content":{"type":"html","$t":"\u003cdiv dir\u003d\"ltr\" style\u003d\"text-align: left;\" trbidi\u003d\"on\"\u003e\nSimple Lexical Analyzer program. It takes the filename in the same directory as the input and analyzes the program for variables operators and special characters. and prints the output for each values separately.\u003cbr /\u003e\n\u003cbr /\u003e\n\u003cpre style\u003d\"background-image: URL(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;\"\u003e\u003ccode style\u003d\"color: black; word-wrap: normal;\"\u003e #include\u0026lt;stdio.h\u0026gt;  \n #include\u0026lt;conio.h\u0026gt;  \n #include\u0026lt;string.h\u0026gt;  \n void main()  \n {  \n      FILE *fp;  \n      int i\u003d0;  \n      char input[100],filename[20];  \n      clrscr();  \n      printf(\"Enter Filename : \");  \n      scanf(\"%s\",filename);  \n      fp\u003dfopen(filename,\"r\");  \n      while(!feof(fp))  \n      {  \n           input[i]\u003dfgetc(fp);  \n           i++;  \n      }  \n      input[--i]\u003d'\\0';  \n      for(i\u003d0;i\u0026lt;strlen(input);i++)  \n      {  \n           if(isalpha(input[i]))  \n           {  \n                printf(\"%c is a Character.\\n\",input[i]);  \n           }  \n           else if(input[i]\u003d\u003d'\u003d'||input[i]\u003d\u003d'+'||input[i]\u003d\u003d'-'||input[i]\u003d\u003d'*'||input[i]\u003d\u003d'/'||input[i]\u003d\u003d'%')  \n           {  \n                printf(\"%c is an Operator.\\n\",input[i]);  \n           }  \n           else if(isspace(input[i])||iscntrl(input[i]))  \n           {  \n           }  \n           else if(isdigit(input[i]))  \n           {  \n                printf(\"%c is a number.\\n\",input[i]);  \n           }  \n           else  \n           {  \n                printf(\"%c is a Special character.\\n\",input[i]);  \n           }  \n      }  \n      getch();  \n }  \n\u003c/code\u003e\u003c/pre\u003e\nNotify the Suggestions about the program through comments ... :)\n\u003c/div\u003e\n"},"link":[{"rel":"replies","type":"application/atom+xml","href":"https://blog.grkweb.com/feeds/8039109526893003507/comments/default","title":"Post Comments"},{"rel":"replies","type":"text/html","href":"https://blog.grkweb.com/2014/07/lexical-analyzer-c-program.html#comment-form","title":"8 Comments"},{"rel":"edit","type":"application/atom+xml","href":"https://www.blogger.com/feeds/5735018943946871385/posts/default/8039109526893003507"},{"rel":"self","type":"application/atom+xml","href":"https://www.blogger.com/feeds/5735018943946871385/posts/default/8039109526893003507"},{"rel":"alternate","type":"text/html","href":"https://blog.grkweb.com/2014/07/lexical-analyzer-c-program.html","title":"Lexical Analyzer"}],"author":[{"name":{"$t":"GRK"},"uri":{"$t":"https://www.blogger.com/profile/00099219911209322075"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"35","height":"35","src":"//www.blogger.com/img/blogger_logo_round_35.png"}}],"thr$total":{"$t":"8"}},{"id":{"$t":"tag:blogger.com,1999:blog-5735018943946871385.post-6469772168426230329"},"published":{"$t":"2014-03-26T10:33:00.000-07:00"},"updated":{"$t":"2014-05-29T10:12:43.691-07:00"},"category":[{"scheme":"http://www.blogger.com/atom/ns#","term":"programming"},{"scheme":"http://www.blogger.com/atom/ns#","term":"c"},{"scheme":"http://www.blogger.com/atom/ns#","term":"TEXT ANALYZER"}],"title":{"type":"text","$t":"Text analyzer"},"content":{"type":"html","$t":"\u003cdiv dir\u003d\"ltr\" style\u003d\"text-align: left;\" trbidi\u003d\"on\"\u003e\n\u003cdiv dir\u003d\"ltr\" style\u003d\"text-align: left;\" trbidi\u003d\"on\"\u003e\nThe following Text analyzer program is implemented in c program. It program analyzes the given text from the user and calculate the number of words and total number of characters in the line of text. It determines the numbers of vowels, consonants, white space characters and other characters for each line. And finally determines average number of vowels, consonants per line.\u003cbr /\u003e\n\u003ch2 style\u003d\"text-align: left;\"\u003e\nConcepts used:\u003c/h2\u003e\n\u003cdiv\u003e\nArray concept is used to store the input text which is to be analysed. The input text is entered during run time. The text contains space hence gets function is used to get the input text from the user.\u003c/div\u003e\n\u003cdiv\u003e\nLocal variables and global variables are used. For loops and while loops are used to calculate the number of characters and words. Function is used to check whether the given character matches with the available character.\u003c/div\u003e\n\u003cdiv\u003e\n\u003cbr /\u003e\u003c/div\u003e\n\u003ch2 style\u003d\"text-align: left;\"\u003e\n\u003cb\u003eSource code:\u003c/b\u003e\u003c/h2\u003e\n\u003c/div\u003e\n\u003cpre style\u003d\"background-image: URL(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;\"\u003e\u003ccode style\u003d\"color: black; word-wrap: normal;\"\u003e #include\u0026lt;stdio.h\u0026gt;  \n #include\u0026lt;conio.h\u0026gt;  \n #include\u0026lt;string.h\u0026gt;  \n int stc(char *,char);  \n void main()  \n {  \n int ch,ln\u003d0,space,vow,con,other,err,tch\u003d0,twrd\u003d0,tvow\u003d0,tcon\u003d0;  \n char txt[500],*l, v[]\u003d\"aeiouAEIOU\";  \n char c[]\u003d\"bcdfghjklmnpqrstvwxyzBCDFGHJKLMNPQRSTVWXYZ\";  \n printf(\"\\t\\t\\t\\tTEXT ANALYZER\");  \n printf(\"\\nEnter the text to be analyzed :\\n\");  \n gets(txt);  \n for(l\u003dstrtok(txt,\".\");l!\u003dNULL;l\u003dstrtok(NULL,\".\"))  \n {  \n ch\u003d1,err\u003d0,vow\u003d0,space\u003d0,other\u003d1,con\u003d0;  \n ln++;  \n if(*l\u003d\u003d' ')  \n {  \n err++;  \n }  \n while(*l!\u003d'\\0')  \n {  \n if(stc(v,*l)\u003d\u003d1)  \n vow++;  \n else if(stc(c,*l)\u003d\u003d1)  \n con++;  \n else if(*l\u003d\u003d' ')  \n space++;  \n else  \n other++;  \n l++,ch++;  \n }  \n if(*(l-1)\u003d\u003d' ')  \n {  \n err++;  \n }  \n printf(\"\\nnumber of vowels in line %d : %d\" ,ln,vow);  \n printf(\"\\nnumber of consonants in line %d : %d\" ,ln,con);  \n printf(\"\\nnumber of white spaces in line %d : %d\" ,ln,space);  \n printf(\"\\nnumber of other characters in line %d : %d\" ,ln,other);  \n printf(\"\\nnumber of words in line %d : %d\" ,ln,space+1-err);  \n printf(\"\\nnumber of characters in line %d : %d\\n\" ,ln,ch);  \n tvow+\u003dvow;  \n tcon+\u003dcon;  \n tch+\u003dch;  \n twrd+\u003dspace+1-err;  \n }  \n printf(\"\\nAverage number of vowels per line : %d\",tvow/ln);  \n printf(\"\\nAverage number of consonants per line : %d\",tcon/ln);  \n printf(\"\\nTotal number of words : %d\",twrd);  \n printf(\"\\nTotal number of characters : %d\",tch);  \n getch();  \n }  \n int stc(char *str, char c)  \n {  \n while(*str!\u003d'\\0')  \n {  \n if(*str\u003d\u003dc)  \n return 1;  \n str++;  \n }  \n return 0;  \n }  \u003c/code\u003e\u003c/pre\u003e\n\u003ch2 style\u003d\"text-align: left;\"\u003e\n\n\u003cdiv style\u003d\"text-align: center;\"\u003e\n\u003c/div\u003e\n\u003cb\u003eOUTPUT:\u003c/b\u003e\u003c/h2\u003e\n\u003cdiv\u003e\n\u003ctable cellpadding\u003d\"0\" cellspacing\u003d\"0\" class\u003d\"tr-caption-container\" style\u003d\"float: left; margin-right: 1em; text-align: left;\"\u003e\u003ctbody\u003e\n\u003ctr\u003e\u003ctd style\u003d\"text-align: center;\"\u003e\u003ca href\u003d\"http://3.bp.blogspot.com/-1VbLHDkwbGk/UzMMKES_1gI/AAAAAAAAAXk/Smo_n__DWNM/s1600/1.png\" imageanchor\u003d\"1\" style\u003d\"clear: left; margin-bottom: 1em; margin-left: auto; margin-right: auto;\"\u003e\u003cimg alt\u003d\"Text analyser sample output\" border\u003d\"0\" src\u003d\"http://3.bp.blogspot.com/-1VbLHDkwbGk/UzMMKES_1gI/AAAAAAAAAXk/Smo_n__DWNM/s1600/1.png\" height\u003d\"278\" title\u003d\"sample output\" width\u003d\"640\" /\u003e\u003c/a\u003e\u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd class\u003d\"tr-caption\" style\u003d\"text-align: center;\"\u003eText analyzer\u003c/td\u003e\u003c/tr\u003e\n\u003c/tbody\u003e\u003c/table\u003e\n\u003cbr /\u003e\n\u003ctable cellpadding\u003d\"0\" cellspacing\u003d\"0\" class\u003d\"tr-caption-container\" style\u003d\"float: left; margin-right: 1em; text-align: left;\"\u003e\u003ctbody\u003e\n\u003ctr\u003e\u003ctd style\u003d\"text-align: center;\"\u003e\u003ca href\u003d\"http://4.bp.blogspot.com/-J8-9RNQ0qoc/UzMMKg40yqI/AAAAAAAAAXs/BFAOgvMZUnc/s1600/2.png\" imageanchor\u003d\"1\" style\u003d\"clear: left; margin-bottom: 1em; margin-left: auto; margin-right: auto;\"\u003e\u003cimg alt\u003d\"text analyzer sample output\" border\u003d\"0\" src\u003d\"http://4.bp.blogspot.com/-J8-9RNQ0qoc/UzMMKg40yqI/AAAAAAAAAXs/BFAOgvMZUnc/s1600/2.png\" height\u003d\"278\" title\u003d\"sample output\" width\u003d\"640\" /\u003e\u003c/a\u003e\u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd class\u003d\"tr-caption\" style\u003d\"text-align: center;\"\u003eText analyzer\u003c/td\u003e\u003c/tr\u003e\n\u003c/tbody\u003e\u003c/table\u003e\n\u003cb\u003e\u003cbr /\u003e\u003c/b\u003e\u003c/div\u003e\n\u003c/div\u003e\n"},"link":[{"rel":"replies","type":"application/atom+xml","href":"https://blog.grkweb.com/feeds/6469772168426230329/comments/default","title":"Post Comments"},{"rel":"replies","type":"text/html","href":"https://blog.grkweb.com/2014/03/text-analyzer-c-program-source-code.html#comment-form","title":"1 Comments"},{"rel":"edit","type":"application/atom+xml","href":"https://www.blogger.com/feeds/5735018943946871385/posts/default/6469772168426230329"},{"rel":"self","type":"application/atom+xml","href":"https://www.blogger.com/feeds/5735018943946871385/posts/default/6469772168426230329"},{"rel":"alternate","type":"text/html","href":"https://blog.grkweb.com/2014/03/text-analyzer-c-program-source-code.html","title":"Text analyzer"}],"author":[{"name":{"$t":"GRK"},"uri":{"$t":"https://www.blogger.com/profile/00099219911209322075"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"35","height":"35","src":"//www.blogger.com/img/blogger_logo_round_35.png"}}],"media$thumbnail":{"xmlns$media":"http://search.yahoo.com/mrss/","url":"http://3.bp.blogspot.com/-1VbLHDkwbGk/UzMMKES_1gI/AAAAAAAAAXk/Smo_n__DWNM/s72-c/1.png","height":"72","width":"72"},"thr$total":{"$t":"1"}}]}});