201 views
0 votes
0 votes
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]);
}
}

Please log in or register to answer this question.

No related questions found