July 13th, 2013, 03:16 AM
I wanted to write a program
" All the words with Minimum four letter word and maximum nine letter word with no letter is repeated more than twice in word. "
atleast All the words with minimum four letter word and maximum nine letter word possible.
Any suggestions or help.
July 13th, 2013, 03:52 AM
What is your definition of "word"?
Is "aaaa" a word, or do you have a dictionary (or word list) containing only valid words?
What you need to do first is get a pencil and some paper, and figure out how to solve the problem on paper.
That is, you need to understand the process which say gets you from "aaaa" to "aaab" up to "aaaz" and then onto "aaba".
Until you understand the mechanics of how it works on paper, you're never going to be able to write the code to do it.
July 13th, 2013, 04:00 AM
You are right. I am not asking about the dictionary words. words could be any with or without any meaning.
even AAbb is a word. and I want output of all the words that can exist with minimum four letters and containing maximum nine letters.
July 13th, 2013, 04:27 AM
int i, word=0,count=0;
if(((*p<='z' && *p>='a') || (*p<='Z' && *p>='A')) && !((*(p+1)<='z' && *(p+1)>='a') ||(*(p+1)<='Z' && *(p+1)>='A')))
July 13th, 2013, 09:50 AM
I assume you have a compiler, and are able to compile and run the code.
Rather than just dump the code (you also forgot the [code][/code] tags, making it unreadable), you should test it yourself.
Now if you had posted the code in code tags, and explained (for example) that it manages to print "aaaa" to "aaaz" but then it goes back to "aaaa" and not the next expected value of"aaba". You see, that would be an actual bug report we could investigate.