Explanation : a + b + c 3 will be 0 if a + b + c is a multiple of 3.
This will happen in one of the following ways.
All three - a, b, and c are multiples of 3. This can only happen if a, b, and c take one of the 10 values.
- 3 , 6, 9 , ..... , 30, independent of one another. So, there are 10 x 10 x 10 = 1000 ways this can happen.
Another possibility is that a, b, and c all leave a remainder 1 so that a + b + c is evenly divisible by 3.
Considering all the different possibilities and adding. we get 9000. That will be the integer that gets printed.