Computer Science, asked by deepaksai6403, 11 months ago

Find the number of "well formed" words(or strings) of a given length(wordlen) which consisted of alphabets(a to z). The number of consecutive words that can occur in a well formed string must not exceed a given value

Answers

Answered by nidaeamann
0

Explanation:

The program as per given requirements mention above can be ;

Program code

Int main (char arr[], int wordlen)

{

int consecutive ;

Int count;

for (i=0; i < wordlen; i ++)

{

 if ( arr[i] >= a or arr[i] <= z )

         if ( arr[i] == arr[i+1])

         consecutive++

         else

         count++

 if  (consecutive > 5)

     break

}

Return count

Similar questions