640 views

3 Answers

Best answer
0 votes
0 votes

  

$st[0] = { \{10 , "Bombay"\}} $

$st[1] = { \{11 , "Computer"\}}$

$st[2] = { \{12 , "Science"\}}$

$st[3] = {\{13 , "Engineering"\}}$

$st[4] = {\{14 , "GateCS"\}}$

$st[5] = {\{15 , "2018"\}}$

$e++->ch$   will give  $st[0].ch$  $\rightarrow$ $Bombay$

$e$ is incremented, now it will point to $st[1]$

$++e$ $\rightarrow$  $e$ is incremented, now it will point to $st[2]$

$++e->ch$ : it will print $cience$

Reason:

$->$ has higher precedence then $++$, so $->$ will be executed first

$e->ch$ will be executed first and will give $Science$

$++(Science)$: move 1 position to the right and point to c and will give output $cience$

$++e++->ch$  will  $ience$

$Reason:$

$->$ has higher precedence then $++$, so $->$ will be executed first

$e++->ch$ will give means $cience$

$++(cience)$ will be incremented and it will be pointing to $i$ and will give  $ience$ 

$e$ is incremented, now it will point to $st[3]$

$e[0].a$  will give $st[3].a$ $\rightarrow$ $13$

$++e->ch$   will give $ngineering$

$Reason:$ 

$->$ has higher precedence then $++$, so $->$ will be executed first

$e->ch$ will give $Engineering$

$++e->ch$  it is increment will point to $n$ of $Engineering$

selected by
0 votes
0 votes
Can you please verify the answer once : -

I got answer as :-

Bombay Engineering ngineering 14 2018

No related questions found