It is syntactically correct (using single-quotes, not double quotes), but since
Code:
while ( ( c = getchar () ) != '\n')
sentence[i++] = c;
guarantees that the only value that c can have after this loop is '\n' [that's the value it has when it exits the loop], your outer while-loop will never see any other condition after the first iteration. The value of c at the start of the first iteration of the loop is undefined (you haven't give c a value), so it may not enter the loop if you are unlucky enough that the "random" value that c happens to have is '*'.
One solution would be that you compare the string sentence with the string-constant "*" using strcmp() - again, make sure the string is initialized, or you'll have undefined behaviour in the first iteration of the loop.
Whilst this is a "style" issue, rather than correct/incorrect code, I would prefer to see the outer loop as a "do - while" rather than "while"...
"do - while" is a "do this at least once, until < some condition > is false", so it's implicit from the code itself that you wish the content of the loop to happen AT LEAST once. It saves the reader of the code to figure out "what is the condition at the beginning of the loop at the first iteration - will this loop be entered at all?".
--
Mats