The logic is wrong, the order of conditions specifically. If the number is not higher than 30 (e.g. 29), then it can't be higher than any other number higher than 30, (29 isn't higher than 49, 76 etc...), so all conditions are never "true" under the " ((int)pshow > 30)" condition.