title: Lexical error vs syntax error in C
body: <p>Consider line number 3 of the following C-program.</p>
  
  <pre><code>int main() {            /*Line 1 */
  int I, N;               /*Line 2 */
  fro (I=0, I&lt;N, I++);    /*Line 3 */
  }
  </code></pre>
  
  <p>Identify the compiler’s response about this line while creating the object-module:</p>
  
  <ol>
  <li>No compilation error</li>
  <li>Only a lexical error</li>
  <li>Only syntactic errors</li>
  <li>Both lexical and syntactic errors</li>
  </ol>
  
  <hr>
  
  <p>My attempt :</p>
  
  <p><code>Line 3</code> has <code>fro</code> instead of <code>for</code> keyword of C. Since, lexical analyzer doesn't bother about wrong keyword, that job of syntax analyzer to ensure correct syntax or keyword (i.e. <code>for()</code> instead of <code>fro()</code>). Lexical analyzer does tokenization of of program.</p>
  
  <blockquote>
    <p>Can you explain in formal way please?   </p>
  </blockquote>