title: Counting number of words which starts with 'A' letter? - C
body: <p>I just started learning C after Java, so it's a little bit confusing to me. I tried to write a program with idea of counting the numbers of words which start with 'A' letter. The problem is that it only reads the first word I enter and ignore the rest of the sentence. Can somebody help me with this one? I would appreciate it.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;string.h&gt;
  
  void main() {
  
      char sentence[200];
      int i;
      int counter = 0;
      printf("Enter sentence: ");
      scanf("%s", &amp;sentence);
  
      for (i = 0; sentence[i] != 0, sentence[i] != ' '; i++){
              if (sentence[i] == 'A') {
                  counter = counter +1;
              }
          }
          printf("No. of A in string %s &gt; %d\n", sentence, counter);
          return 0;
      }
  </code></pre>