I am trying to write a C program with a Array of 6 elements where the number of bits of the value in each element is counted and added to the sixth element of the array. Would the piece of code I have below work?

Firstly, you should not access location Array[5], as it does not exist.
Remember that reserving 5 locations gives access to offsets 0, 1, 2, 3, and 4 only.
The best fix here is to use a new variable, "total", to hold the sum.
Also, you need to initialize the Array with some numbers.

Secondly, you must assign Array to x before the inner loop, otherwise
you re-initialize x every time and you end up summing bit 0 eight times
on each array element.

Lastly, you need to use x >>= 1 to assign the result to x (this is equivalent
to x = x >> 1);