Back to the 2026 paper

Module 1: Introduction, Lexical Analysis

20262m

Consider the statement: int total = 25; Which of the following represents a lexeme?
(i) int
(ii) 25
(iii) total
(iv) All of the Above

Worked SolutionAI Assisted

Answer: (iv) All of the Above

Explanation

A lexeme is the actual sequence of characters in the source program that matches the pattern of a token. The scanner groups the characters of int total = 25; into these lexemes:

Lexeme Token class
int keyword
total identifier
= assignment operator
25 integer constant
; separator

So int, total and 25 are all lexemes.

(iv) All of the Above\boxed{\text{(iv) All of the Above}}

Similar questions

AI LearningWeb Platform

Coursify — Personal AI Course Generator

Struggling with a difficult subject or concept? Turn any engineering topic into a structured course with interactive lessons, quizzes, and research-backed explanations.