edited by
2,609 views

4 Answers

1 votes
1 votes

$\textrm{Total number of token is 7 here.}$

  1. $printf$
  2. $($
  3. $\textrm{”A%B”}$
  4. $\textrm{&}$
  5. $i$
  6. $)$
  7. $;$

$\textrm{Option A }$

0 votes
0 votes

the tokens are:

  1. printf - a function that prints output to the console
  2. ( - left parenthesis
  3. "A%B=" - a string literal
  4. , - a comma
  5. & - the address-of operator
  6. i - a variable
  7. ) - right parenthesis

The semicolon at the end of the statement is not a token. It is a statement terminator that indicates the end of the statement in C-style languages.

0 votes
0 votes

I See that people are merely justifying the answers key with 7 tokens, but the real answer is going to be 8 tokens.

Someone missed comma, someone says semicolon is not included etc; ignore them and see the official grammar of C  - both $comma$ and $semicolon$ are valid tokens.

Here is breakdown for all 8 tokens in the statement :

Tokens and Their Values
Token CategoryToken NumberToken Value
identifier1'printf'
l_paren2'('
string_literal3'"A%B="'
comma4','
amp5'&'
identifier6'i'
r_paren7')'
semi8';'
Answer:

Related questions

1 votes
1 votes
3 answers
1
Arjun asked Dec 7, 2018
2,011 views
The context free grammar $S \rightarrow aSb \mid bSa \mid \epsilon$ generates:Equal number of a’s and b’sUnequal number of a’s and b’sAny number of a’s followed...
1 votes
1 votes
3 answers
2
Arjun asked Dec 7, 2018
1,180 views
The language $\{ W^a X^b Y^{a+b} \mid a, b, >1\}$ isRegularContext-free but not regularContext sensitive but not context freeType$=0$ but not context sensitive
0 votes
0 votes
2 answers
3
Arjun asked Dec 7, 2018
2,177 views
Among all given option, ____ must reside in the main memory.AssemblerCompilerLinkerLoader
1 votes
1 votes
2 answers
4
Arjun asked Dec 7, 2018
4,348 views
Which of the following code replacements is an example of operator strength reduction?Replace $ \text{P^2} $ by $P^*P$Replace $ P^*16$ by $P<<4$Replace $ \text{pow}(P,3) ...