p(x) = 124-x/16
P(x) is the price of a candy bar. Then if we assume we sold x thousand of candy bars the revenue R(x) = p(x)*x
So R(x) = (124-x/16)*x = 124x-x^2/16
To R(x) to be a maximum or minimum R'(x) = 0
But if R(x) is a maximum then R''(x) <0 or negative.
R'(x) = 124-2x/16
If R(x) is a maximum or minimum R'(x)= 0
Then 124-2x/16 = 0
Lets consider R''(x)
R''(x) = 0-2/16 = -1/8<0 negative value.
This means R(x) is a maximum. R(x) is maximum when x=992 thousand.
So to get maximum revenue you should sell 992000 candy bars.