Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

4.The following EBNF rules describe the syntax of decimal integer constants in C

ID: 3758033 • Letter: 4

Question

4.The following EBNF rules describe the syntax of decimal integer constants in C99. Write a single Perl pattern that matches these constants. Simplify your pattern as much as possible.

integer-constant:
   decimal-constant integer-suffixopt decimal-
  
constant:
   nonzero-digit
   decimal-constant digit

integer-suffix:
   unsigned-suffix long-suffixopt unsigned-
   suffix long-long-suffix
   long-suffix unsigned-suffixopt
   long-long-suffix unsigned-suffixopt

unsigned-suffix: one of
   u U

long-suffix: one of
   l L

long-long-suffix: one of
   ll LL

Explanation / Answer

#include <stdio.h>
  
    /* print the numbers from 1 to 10 */

    int
    main(int argc, char **argv)
    {
       int i;

      puts("Now I will count from 1 to 10");
      for(i = 1; i <= 10; i++) {
         printf("%d ", i);
      }

      return 0;
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote