Is it correct to use do while loop inside a for loop? Why and why not :     //program to count words
    #include<stdio.h>
    int main()
    {  int i;
        int word=0;
        char sent[]="How are you doing mister";  //character pointer
        for(i=0;sent[i]!='\0';i++)
        {
            do
        {
            word++;

        }    while(sent[i]==' ');
        }
        printf("There are %d words in the sentence\n", word+1);  //words are always 1 more than the no. of spaces.
    return 0;
    }                                                          //or word=1;

This is a code for counting the number of words. Please tell me why cannot we use do while inside a for loop. Or if we can, how to do it.