Modulo doesn't find year, it returns the remainder after a division.
The modulo operator is %
.
For example:
#include <iostream>
int main() {
int x;
x = 10 % 8;
std::cout << x << std::endl; // output is 2
return 0;
}
Given your example, the following code would perform the same order of operations as your question. Notice the use of the long long int data type. Values this high (12-digit numbers) can only be expressed using long long int type.
#include <iostream>
int main() {
// declare variable id = 199734902138 and initial answer
long long int id = 199734902138;
long long int answer = id % 100000000;
// answer is now 199700000000
answer = id - answer;
//final calculation, divide the answer by 100000000
id = answer / 100000000;
// output id for verification
std::cout << id <<std::endl;
return 0;
}
As mentioned, this is all a bit superfluous as a simple divide operation will yield the same result, however if these steps need to be explicitly used in your calculation, then the code above would fit.