Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- int broj, suma=0;
- cout << "Unesi jedan trocifreni broj: ";
- cin >> broj;
- do
- {
- suma += broj % 10;
- broj /= 10;
- } while (broj>0);
- cout << suma;
- system("pause > nul");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment