Hello and thank you for submitting your question!
An apple can range from 78-116 calories depending on its size, and there are 4 calories per gram of carbohydrate. Given your example, you are correct in that there are 88 calories from sugar (22g x 4 calories per gram sugar = 88 calories); however, the calories from sugar are already factored in the total amount of calories. Therefore, there is no need to add the 88 calories from sugar to the total 100 calories.
Nutrition facts can be very confusing and overwhelming at times! You can find more information and resources on how to read food labels and how to use them as a tool for making more mindful food choices here.
Hope that helps!