Question: Modify the original code to count the times a Number occurs. A number is defined as [ 0 - 9 ] + The code is:

Modify the original code to count the times a Number occurs. A number is defined as [0-9]+
The code is: int counter=0; //added counter variable to count the times a number occurs %
[a-zA-Z]+ Igths[yyleng]; //number of numbers ++ between 0-9
. I
In ;//skip if not a letter like no op
%%//separator
// called at the end of file
int yywrap()
{
int i;
printf("Length No. words ??
");
for
if (lgths [i]>0
printf("%5d%10d
",i,lgths[i]);
}
}
printf("Number of numbers: %d
", counter); //prints
the number of numbers
return(1);
 Modify the original code to count the times a Number occurs.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!