How to measure calories??

How do I measure calories??? Just bought a protein bar, and it has 24g protein, 39g carbohydrate, and 5g of fat. Let's say it has XXXg of calories, how could I find out if I only had stats from protein, carb, and fat??
 
protein and carbs are 4 calories per gram. fat is 9 calories per gram.

24 X 4 = 96
39 X 4 = 156
5 X 9 = 45

96 + 156 + 45 = 297

be aware that they'll probably round the number up or down so they wont exactly come out even.
 
Back
Top