%{
#include <stdio.h>
#include <stdlib.h>
%}

digit   [0-9]
number  {digit}+   // Matches one or more digits (integer numbers)

%%

{number}  {
            int num = atoi(yytext);  // Convert the matched string to an integer
            if (num % 2 == 0) {
                printf("%d is Even\n", num);
            } else {
                printf("%d is Odd\n", num);
            }
        }

.|\n    { /* Ignore non-digit characters and newlines */ }

%%

int main() {
    printf("Enter a number: ");
    yylex();  // Start lexical analysis to process input
    return 0;
}
