My code is counting all digits what to change

int n=s.nextInt();//number
int a=s.nextInt();//digit to find
int count=0;
while(n!=0) {
if(n%10==a);
count++;

		n=n/10;
		
		
	}
	System.out.println(count);
	
}

}

@ritusitlani Just look at your code you have mistakenly terminated the if condition and that is why your code is counting all the digits.
Just correct your if(n%10==a); this line of code by removing the semicolon.

thankyou got it.working fine now