A dice has 6 faces with the numbers 1 to 6. When two dice are tossed, a sum of 5 can be got in the following ways: (1, 4), (4, 1), (2, 3), (3, 2). The number of times a sum of 5 can be obtained is 4.
The number of ways of getting a sum of 10 is (6, 4), (4, 6), (5, 5). A sum of 10 is obtained 3 times.
The number of ways in which either a sum of 5 or 10 can be got is the sum of the individual values for 5 and 10 or 4 + 3 = 7.
I think the oirigial question (which salonigaba should read again) is misleading and that it becomes quite complicated when involving dice (or craps). There is a big difference between "ways" and "times." If you roll a pair of dice 36 times you may get a 5 or a 10 on 7 of those rolls. On the other hand, you may not get a 5 or a 10 even once in 36 rolls. There is no guarantee. You might get a 5 or a 10 a dozen times in 36 rolls. There is only a probability that you would get a 5 or a 10 7 times in 36 rolls, but you would have to roll those dice a thousand or more times before you would probably find that you were getting a 5 or a 10 approximately 20% of the times. 7 is approximately 20% of 36, so there is a probability that you would get a 5 or 10 once on ever 5 rolls--but don't bet your money on it! As a matter of fact, if you decided to roll those dice a thousand or ten thousand times, you would have to use some sort of mechanical device to roll them, because the way you picked them up with your hand and the way you repetitiously threw them could drastically affect the results.
I believe the question is somewhat misleading. You could get 5 or 10 hundreds of times if you kept throwing the dice. The question should be: How many ways can you make 5 or 10 on the first roll out of a total of 36 possible combinations? The answer 7 is correct if the question is phrased more or less as I have stated.