The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
0 votes
19 views
What will be the value of z at the end of the following program?

int value(int *x) {
  static int count;
  while(*x) {
  count = count + (*x & 1);
  *x>> =1;
   }
return count;
}
main( ) {
int a[ ]={3,5,6,4};
int y = 0 ,z = 0;
for(; y < sizeof(a)/sizeof(int) ; y++) {
 z = a[y] + value( &a[y]);
}
}
asked in Programming by (183 points) | 19 views
0

check this and after that if your doubt will not clear then let us know...

https://gateoverflow.in/118442/gate2017-1-55

 

Please log in or register to answer this question.

Related questions

0 votes
0 answers
2
asked Jan 11 in Programming by Ajit J (469 points) | 62 views
+1 vote
1 answer
3
asked Jan 2 in Programming by Shadan Karim Junior (637 points) | 51 views
0 votes
1 answer
4
asked Jan 2 in Programming by Shadan Karim Junior (637 points) | 32 views
0 votes
0 answers
5
asked Dec 30, 2018 in Programming by Shadan Karim Junior (637 points) | 56 views
0 votes
1 answer
6
asked Dec 30, 2018 in Programming by Shadan Karim Junior (637 points) | 67 views
0 votes
0 answers
7
asked Dec 30, 2018 in Programming by Shadan Karim Junior (637 points) | 122 views
Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
49,540 questions
54,099 answers
187,269 comments
71,006 users