Powers of 2:
2, 4, 8, 16, 32, 64, 128, 256...
Last digits:
2, 4, 8, 6, 2, 4, 8, 6...
Last digit of 2^i is:
int arr[4] = {2, 4, 8, 6};
return arr[(i-1)%4];
6
solved Finding the last digit of a very large 2^n number [closed]
Powers of 2:
2, 4, 8, 16, 32, 64, 128, 256...
Last digits:
2, 4, 8, 6, 2, 4, 8, 6...
Last digit of 2^i is:
int arr[4] = {2, 4, 8, 6};
return arr[(i-1)%4];
6
solved Finding the last digit of a very large 2^n number [closed]