Complete the first two sections of the following LEX program
such that it generates a scanner which counts the number of characters and the
number of lines in its input file.
This scanner produces no output other
than the final report on the counts.
Answer 1
%%
%%
main()
{
yylex();
printf( "# of lines = %d, # of chars = %d\n",
num_lines, num_chars );
}