private static void reverse(int value) {
int temp = 0;
int temp1 = 0;
while (value != 0) {
// Take the values length-1
temp = value / 10;
// Take the last value
temp1 = value % 10;
// assign last value removed integer
value = temp;
System.out.print(temp1);
}
}
int temp = 0;
int temp1 = 0;
while (value != 0) {
// Take the values length-1
temp = value / 10;
// Take the last value
temp1 = value % 10;
// assign last value removed integer
value = temp;
System.out.print(temp1);
}
}
No comments:
Post a Comment