I'm new to programming and stuck in a problem. I have a long variable of any length. I want to extract any number of digits of this number. An Example: Number = 135678256 and I want the first two digits, here 13. I added some pseudo-code, which shall represent my first idea.
int digits(long n){
int x = n / (10^ length(long n)) ;
int y = n / (10^(length(long n)-1)) ;
y = x-y;
return x,y};
length is a function that returns the length of Number.
How to change my code efficiently to get the fourth and fifth digits? Thanks a lot!