How many of the integers 0, 1, 2, . . . , 999 are neither divisible by 9 nor contain the digit 9?
n=0;p=0;cycle: a=(1+n);b=int(a/100)%10;c=int(a/10)%10;d=a%10; n++;if(a%9!=0 and b!=9 and c!=9 and d!=9, goto loop, goto cycle);loop:p=p+1;printa," ",;if(n<=810, goto cycle, discard=0;print"Total = ",p
OUTPUT = 648 such numbers.