Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int broj;
- cin >> broj;
- int posledna_cifra = broj % 10; // ostatok pri delenje na broj so 10
- cout << posledna_cifra << endl;
- return 0;
- }
- // 12345 / 10 = 1234, остаток 5
- // 67123 / 10 = 6712, остаток 3
Advertisement
Add Comment
Please, Sign In to add comment