Lex Program to Identify the Type of Number [Compiler]
This is the lex program to identify the type of number using regular expressions [cc lang=”c”] %{ #include int a=0,b=0,c=0,d=0; %} %% [+]?[0-9]+ {printf(“Postive Integer %d”,a);a++;} [-]{1}[0-9]+ {printf(“Negative Integer %d”,b);b++;} [+]?[0-9]+[.]{1}[0-9]+ {printf(“Postive Fraction %d”,c);c++;}...
Recent Comments