0% found this document useful (0 votes)
2 views

Tokens in C notes

The document consists of a quiz on tokens in the C programming language, identifying valid and invalid tokens, types of tokens, and examples of each. It highlights that there are six types of tokens in C and provides specific examples for each category. The answers to the quiz questions are also included, indicating which options are correct.

Uploaded by

Vijaya kumari
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Tokens in C notes

The document consists of a quiz on tokens in the C programming language, identifying valid and invalid tokens, types of tokens, and examples of each. It highlights that there are six types of tokens in C and provides specific examples for each category. The answers to the quiz questions are also included, indicating which options are correct.

Uploaded by

Vijaya kumari
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

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

You might also like