I tried the below program . 

INPUT-: i want help 
Desired OUTPUT-:Words=3 Characters=9

But the actual output deviates from the desired.
Can someone tell what is my mistake .

include
=======

```
void main()
{
  int countch=0;
  int countwd=1;

  printf("Enter your sentence in lowercase: ");
  char ch='a';
  while(ch!='\r')
  {
    ch=getche();
    if(ch==' ')
      countwd++;
    else
      countch++;
  }

  printf("\n Words = ",countwd);

  printf("Characters = ",countch-1);

  getch();

}

```