Here is the code for the same .
When I give a=11 and b=44 .then wile loop for a must stop at 20 as 20%10==0 but its not stopping.
int a,b;
cin>>a>>b;
int total=0;
while((a%10!=0)||(a!=b))
{ cout<<"a is "<<a%10<<"\n";
if((a%10==2)||(a%10==3)||(a%10==9))
total+=1;
a++;
}