I need help understanding the do-while loop in this code. Im confused in how this do- while works because what i understand is the statement is executed then the expression is evaluated if nonzero and executes whats in while(). But its a loop so for example if i type Jack Smith should in it print multiple J's ? Plz help to understand the logic
int main()
{
char init,ch;int i;
printf("Enter phrase:");
for(i=0;i < 5; i++)
init=getchar();
while((ch=getchar())!=' ')
;
while((ch=getchar())==' ')
;
do
{
printf("%c",ch);
}
while((ch=getchar())!='\n');
{
//printf(" %c.\n",init);/
}
return 0;
}
}