1 votes 1 votes Find the output of the following program : #include <stdio.h> main () { int a, b; int v=3; int *pv; a = 2 * (v+5); pv = &v; b = 2*(*pv + 5); printf("\n a=%d b=%d " , a,b); } $a = 16$ , $b = 16$ $a = 16$ , $b = 32$ $a = 16$ , $b = 8$ $a = 16$ , $b = 64$ GATE tbb-mockgate-1 programming-in-c programming pointers + – Bikram asked Jan 16, 2017 retagged Jan 9, 2020 by Arjun Bikram 292 views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
Best answer 2 votes 2 votes a = 2 * (v + 5) = 2 * (3 + 5) = 2 * 8 = 16 b = 2 * (*pv + 5) , now here v and (*pv) represent the same integer value, that is 3 . so, b = 2 * (3 + 5) = 16, hence a = 16,b = 16 Bikram answered Jan 16, 2017 selected Jan 17, 2017 by Bikram Bikram comment Share Follow See all 0 reply Please log in or register to add a comment.