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?
(A) (L + D) *
(B) (L.D) *
(C) L(L + D) *
(D) L(L.D) *
Explanation: Clearly, option (C) is correct as a valid identifier can only start with a letter followed by any number of letters or digits.
L(L + D) * can only generate the strings for a valid identifier.
Quiz of this Question
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.