Computer Science, asked by sayyedsajdeen786, 5 months ago


int num=564,a;

while(num>0)

{a=num%10;

num/=10;

}

System.out.print(a);​

Answers

Answered by Oreki
4

Snippet:

     int num = 564, a = 0;

     while (num > 0) {

         a = num % 10;

         num /= 10;

     }

     System.out.print(a);

Output:

  5

Similar questions