Tokens in C
1. Which of the following is not a valid token in C?
a) Identifier
b) Keyword
c) Compiler
d) Constant
Answer: c) Compiler
2. Which one of the following is a valid token in C?
a) main
b) 123abc
c) @int
d) #define
Answer: a) main
3. In C, tokens are the smallest unit in a program. How many types of
tokens are there in C?
a) 4
b) 6
c) 5
d) 3
Answer: b) 6
4. Which of the following is not a type of token in C?
a) Operator
b) Delimiter
c) Identifier
d) Preprocessor directive
Answer: d) Preprocessor directive
5. Which of the following symbols is a token?
a) =
b) @
c) #
d) :
Answer: a) =
6. Which of these is a constant token?
a) int
b) +
c) 100
d) main
Answer: c) 100
7. The semicolon (;) in C is considered as:
a) Keyword
b) Operator
c) Separator
d) Identifier
Answer: c) Separator
8. Which of the following is a string literal token?
a) "C Programming"
b) 'a'
c) 100
d) main
Answer: a) "C Programming"
9. Which one is not an operator token?
a) +
b) -
c) *
d) printf
Answer: d) printf
10. Which of the following is not a valid C token?
a) main()
b) "hello"
c) @name
d) 100.0
Answer: c) @name