// on line number 4 (int rem = n%10;). After getting the remainder of every time loop runs. Does the n variable will keep getting changed. If so why. As per knowledge in java if you make any changes inside the specific block. It should not affect anything that are present outside of block. Please correct me if I am wrong, sorry if you could not understand my question here. I tried to explain as detail as I can. Thank you
''' // print the input in reverse order?
int n= 135363;
int ans = 0;
while(n>0) {
int rem = n % 10;
n /=10;
ans = ans * 10 + rem;
}
System.out.println(ans); '''