Integer9. A three-digit number is given. Using one integer division operation, output the first digit of a given number (hundreds).

Solution in Python 3:

import random

N = random.randrange(100,1000)
print("Number: ", N)
d2 = int(N/100)
print("Hundreds: ", d2)

Solution in C++:

#include <iostream>
using namespace std;
int main(){
int n;
cout << "Enter the number N: ";
cin >> n;
cout << "First digit of the number: " << int(n/100);
return 0;
}