int main()
{
int countch=0;
int countwd=1;
cout << "Enter your sentence in lowercase: " << endl;
char ch='a';
while(ch!='\r')
{
ch=getche();
if(ch==' ')
countwd++;
else
countch++;
}
cout << "\n Words = " << countwd << endl;
cout << "Characters = " << countch-1 <<endl;
getch ();
return 0;
}
my question is when u enter "good boy" why is that the cout of words are 2 and the characters is 7?