Integer2. Given the mass M in kilograms. Using the operation of integer division, find the number of full tons in it (1 ton = 1000 kg).

Solution in Python 3:

M = int(input("Enter the mass in kilograms (M): "))
m = int(M / 1000)
print("Number of full tons: ", m)

Solution in C++:

#include<iostream>
using namespace std;
int main(){
int m, t;
cout << "Enter the mass in kilograms (M): ";
cin >> m;
t = int(m/1000);
cout << "Number of full tons: " << t;
return 0;
}