What value will be returned if the function call is func4 1
Solution
Please follow the code and comments for description :
CODE :
#include <stdio.h> // header files
int func(int x) { // fucntion declaration
 int count = 0;
 while(x) { // iterate over the loop
 count++; // increment
 x = x & (x - 1); // check for the values
 }
 return count; // return the count
 }
int main(void) { / driver method
   
    int c = func(14); // call the function
    printf(\"%d\", c); // print the data
    return 0;
 }
a) When this function is called this prints the value 3 as when compared with the value over the binary \'and\' operator this do satify for the first three loop and thus rejects over the fourth loop making the 3 as the value to be returned as the count.
So the answer is OPTION C (3).
b) The function func does the count of the number of ones ove the integre passed with the conversion to the binary format. So the answer is OPTION D (Count the number of 1\'s in the binary representation of a decimal number).
 Hope this is helpful.

