In some programming languages, an identifier is permitted to be a letter…
2017
In some programming languages, an identifier is permitted to be a letter followed by any number of letters or digits. If L and D denotes the set of letters and digit respectively. Which of the following expression defines an identifier?
Answer: C. L(L + D) * — An identifier must start with a letter (L). Following this, it can contain any number of letters or digits ((L + D)*). Therefore, the regular expression…
- A.
(L + D) *
- B.
(L.D) *
- C.
L(L + D) *
- D.
L(L.D) *
Attempted by 215 students.
Show answer & explanation
Correct answer: C
An identifier must start with a letter (L). Following this, it can contain any number of letters or digits ((L + D)*). Therefore, the regular expression defining an identifier is L(L + D)*.
Explore the full course: Iocl Engineers Officers Grade A Paper 2
Loading lesson…