If i\'m giving values like a=1234, i want to print last two digits 34 only.. can anyone give me solution for this...
int a=1234; System.out.print(a);
number % 100 will result in last 2 digit
number % 100
See
User modulo 100
System.out.print(String.format("%02d", (abs(a)%100)));
You can try this too
int a=1234; System.out.print(String.valueOf(a).substring(2));
Out put
34