title: What exactly is \r in C language?
body: <pre><code>#include &lt;stdio.h&gt;
  
  int 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 =%d ",countwd);
  
    printf("Characters = %d",countch-1);
  
    getch();
  }
  </code></pre>
  
  <p>This is the program where I came across <code>\r</code>. What exactly is its role here? I am beginner in C and I appreciate a clear explanation on this.</p>