4,679 views
7 votes
7 votes

Consider the following declaration:

  int a, *b=&a, **c=&b;

The following program fragment

  a=4;    **c=5;
  1. does not change the value of a
  2. assigns address of $c$ to $a$
  3. assigns the value of $b$ to $a$
  4. assigns $5$ to $a$

3 Answers

Best answer
13 votes
13 votes

answer = option D

In the above figure each '*' operator corresponds to a back edge. 

0 votes
0 votes

integer a.

b is a pointer that points to a.

c is a pointer to a pointer, and the latter is b.

a = 4.

dereference c twice, we reach a. $c\rightarrow b\rightarrow a$ (One $\rightarrow$ for each $*)$

So, a = 5.

Option D

Answer:

Related questions

9 votes
9 votes
5 answers
1
go_editor asked Jun 21, 2016
6,121 views
The for loopfor (i=0; i<10; ++i) printf("%d", i&1);prints0101010101011111111100000000001111111111
10 votes
10 votes
4 answers
2
go_editor asked Jun 21, 2016
9,377 views
The output of the following program ismain() { static int x[] = {1,2,3,4,5,6,7,8} int i; for (i=2; i<6; ++i) x[x[i]]=x[i]; for (i=0; i<8; ++i) printf("%d", x[i]); }1 2 3 ...
8 votes
8 votes
2 answers
3
go_editor asked Jun 21, 2016
7,630 views
Consider the following program fragmenti=6720; j=4; while (i%j)==0 { i=i/j; j=j+1; }On termination j will have the value4896720
7 votes
7 votes
3 answers
4
go_editor asked Jun 21, 2016
6,608 views
The following programmain() { inc(); inc(); inc(); } inc() { static int x; printf("%d", ++x); }prints 012prints 123prints 3 consecutive, but unpredictable numbersprints 1...