in Programming in C edited by
948 views
0 votes
0 votes

in Programming in C edited by
948 views

6 Comments

There are two mistakes in this program excluding the sizeof typo, one the braces after main and other passing a[y] without reference.

Answer would be compile time error
0
0
Made easy has given the solution 11
0
0
If the program would have been right , the answer would be 11, or 4 (this is what my program run is showing ) but anyways  I will tell you how they computed
0
0
Yes please, show the evaluation

I am not able to understand this.
0
0

Here is a rough draft, 

0
0

check this out i wrote the program with few corrections, but it prints 5, you can run it online here, it returns the final value of count as 1 which adds with 4 in main() , i think it is not recognizing static for count.

https://onlinegdb.com/S1dNCGOJ4

0
0

1 Answer

1 vote
1 vote

Answer Will Be 11.

In the Value program the count will be incremented depends on the number of one present in the binary representation of the X passed to the value function.

And the final answer of the z depends on the last value in the array + the count all the number present in the array.

Related questions