GATE Exam  >  GATE Questions  >   Which of the following is not a token in C l... Start Learning for Free
Which of the following is not a token in C language.
  • a)
    Semicolon
  • b)
    Identifier
  • c)
    Keyword
  • d)
    White space
Correct answer is option 'D'. Can you explain this answer?
Verified Answer
Which of the following is not a token in C language.a)Semicolonb)Iden...
C tokens are:
I. Keywords
II. Identifiers.
III. Constants.
IV. Symbols (;, (, ), }, {, etc)
V. Operators.
White spaces are used to separate the tokens but not counted as a token. White spaces are ignored while identifying the tokens.
View all questions of this test
Most Upvoted Answer
Which of the following is not a token in C language.a)Semicolonb)Iden...
Token in C language

A token in programming languages is the smallest unit of meaning or a lexeme that the compiler recognizes. In the C language, tokens can be classified into several categories, including keywords, identifiers, constants, string literals, operators, and punctuators.

Explanation:

Keywords:
Keywords in C language are reserved words that have predefined meanings and cannot be used as identifiers. Some examples of keywords in C are `if`, `else`, `for`, `while`, `int`, `float`, `void`, etc. Keywords are used to define the syntax and structure of the language.

Identifiers:
Identifiers are names given to variables, functions, or any other user-defined entities in a program. These names are used to refer to the entities in the program. An identifier can consist of letters, digits, and underscores, but it must start with a letter or an underscore. Examples of identifiers in C are `count`, `sum`, `average`, etc.

Constants:
Constants are fixed values that do not change during the execution of a program. There are different types of constants in C, including integer constants, floating-point constants, character constants, and string literals. Examples of constants in C are `10`, `3.14`, `'A'`, `"Hello"`, etc.

Operators and Punctuators:
Operators are symbols that perform mathematical or logical operations on operands. Examples of operators in C are `+`, `-`, `*`, `/`, `%`, `==`, `!=`, `&&`, `||`, etc.

Punctuators are symbols used for punctuations and grouping in C programs. Examples of punctuators in C are `,`, `;`, `()`, `{}`, `[]`, etc.

Whitespace:
Whitespace refers to spaces, tabs, and newlines in a program. It is used to separate tokens and improve the readability of the code. Whitespace is not considered a token in C language as it does not have any meaning or significance in the program execution.

Conclusion:
In the given options, the correct answer is option 'D' - Whitespace. Whitespace is not considered a token in the C language. Tokens in C include keywords, identifiers, constants, operators, and punctuators, but whitespace is not considered a token as it does not have any meaning or significance in the program execution.
Explore Courses for GATE exam
Which of the following is not a token in C language.a)Semicolonb)Identifierc)Keywordd)White spaceCorrect answer is option 'D'. Can you explain this answer?
Question Description
Which of the following is not a token in C language.a)Semicolonb)Identifierc)Keywordd)White spaceCorrect answer is option 'D'. Can you explain this answer? for GATE 2024 is part of GATE preparation. The Question and answers have been prepared according to the GATE exam syllabus. Information about Which of the following is not a token in C language.a)Semicolonb)Identifierc)Keywordd)White spaceCorrect answer is option 'D'. Can you explain this answer? covers all topics & solutions for GATE 2024 Exam. Find important definitions, questions, meanings, examples, exercises and tests below for Which of the following is not a token in C language.a)Semicolonb)Identifierc)Keywordd)White spaceCorrect answer is option 'D'. Can you explain this answer?.
Solutions for Which of the following is not a token in C language.a)Semicolonb)Identifierc)Keywordd)White spaceCorrect answer is option 'D'. Can you explain this answer? in English & in Hindi are available as part of our courses for GATE. Download more important topics, notes, lectures and mock test series for GATE Exam by signing up for free.
Here you can find the meaning of Which of the following is not a token in C language.a)Semicolonb)Identifierc)Keywordd)White spaceCorrect answer is option 'D'. Can you explain this answer? defined & explained in the simplest way possible. Besides giving the explanation of Which of the following is not a token in C language.a)Semicolonb)Identifierc)Keywordd)White spaceCorrect answer is option 'D'. Can you explain this answer?, a detailed solution for Which of the following is not a token in C language.a)Semicolonb)Identifierc)Keywordd)White spaceCorrect answer is option 'D'. Can you explain this answer? has been provided alongside types of Which of the following is not a token in C language.a)Semicolonb)Identifierc)Keywordd)White spaceCorrect answer is option 'D'. Can you explain this answer? theory, EduRev gives you an ample number of questions to practice Which of the following is not a token in C language.a)Semicolonb)Identifierc)Keywordd)White spaceCorrect answer is option 'D'. Can you explain this answer? tests, examples and also practice GATE tests.
Explore Courses for GATE exam
Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev