Integer10. A three-digit number is given. Firstly, output its last digit (units), and then - its middle digit (tens).

Solution in Python 3:

import random

N = random.randrange(100,1000)
print("Number: ", N)
d1 = int((N-d2*100)/10)
d0 = N%10
print("Units: ", d0)
print("Tens: ", d1)

Solution in C++:

#include <iostream>
using namespace std;
int main(){
int n;
cout << "Enter the number N: ";
cin >> n;
cout << "Units: " << n%10 << endl;
cout << "Tens: " << int(n/10)%10;
return 0;
}