Any number between 1 to 999 is of the form abc when 0≤a,b,c≤9. Let us first count the number in which 5 occurs exactly once. Since, 5 can occur at one place in 1x3C1×9×9=243 ways, next 5 can occur in exactly two places in 3C2×9=27. Lastly, 5 can occur in all three digits in only one way. Hence, the number of times 5 occurs =1×243+27×2+1×3 =243+54+3=300