Sharecodepoint App Download Qrcode Sharecodepoint Android App Banner
Now You can search anything in sharecodepoint using your voice. Click on mic button. Sharecodepoint Voice Sharecodepoint Youtube Channel

Sharecodepoint popular queries

Saturday, 23 February 2019

Program to count the number of characters, words, spaces, end of lines in a given input file. | Compiler Design Programs | Lex Programs

Compiler Design Lab Program : 

 Int c=0, w=0, s=0, l=0;
WORD [^ \t\n,\.:]+
EOL [\n]
{WORD} {w++; c=c+yyleng;}
{BLANK} {s++;}
{EOL} {l++;}
. {c++;}
int yywrap()
return 1;
main(int argc, char *argv[])
 printf(“Usage: <./a.out> <sourcefile>\n”);
printf(“No of characters=%d\nNo of words=%d\nNo of
spaces=%d\n No of lines=%d”,c,w,s,l);


Post a Comment


Version - 2016 - 2019 - © Sharecodepoint | Made in India. | Copyright Content