int num=564,a;
while(num>0)
{a=num%10;
num/=10;
}
System.out.print(a);
Answers
Answered by
4
Snippet:
int num = 564, a = 0;
while (num > 0) {
a = num % 10;
num /= 10;
}
System.out.print(a);
Output:
5
Similar questions