Computer Science, asked by NeneAmaano8773, 11 months ago

Write a java
program to accept a number and a single digit number check whether the single digit number is present in the number

Answers

Answered by devikamj5rv
2

Answer:

single digit is present in a no. or not

Explanation:

int n=Integer.parseInt(br.readLine());

//input a no. in 'n'.

int dg=Integer.parseInt(br.readLine());

//input a digit in 'dg'.

while(n>0)

{int d=n%10;

if(d==dg)

{System.out.println("input digit is present in the no.");break;}

else

n/=10;}

Similar questions