There are 10 boys and 8 girls in a class.
The teacher wants to select just one to represent the class.
One boy out of 10 can be selected in 10 ways.
Similarly, one girl out of 8 can be selected in 8 ways.
So, if he has to select either a boy OR a girl, he can do it in total 10+8 number of ways. i.e 18