COMPILER DESIGN

SYNTAX ANALYSIS

ROLE OF THE PARSER

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Identify the number of tokens in the following C statement printf("i = %d, &i = %x", i, &i);
A
4
B
10
C
15
D
21
Explanation: 

Detailed explanation-1: -C Tokens are of 6 types, and they are classified as: Identifiers, Keywords, Constants, Operators, Special Characters and Strings.

Detailed explanation-2: -Tokens types are keywords, identifiers, constants, strings, operators, etc. Therefore, there are 10 tokens in total.

Detailed explanation-3: -So, total 10 tokens are there in the given statement.

Detailed explanation-4: -4 Answers. Number of tokens in int a[5]; will be 6 .

There is 1 question to complete.