I cant get this code to work.

#include <iostream>
using namespace std;

int main()
{
int num = 0, num2 = 0, digit1 = 0, digit2 = 0, digit3 = 0, digit4 = 0;
cout << "Enter a number between 0 and 1000: ";
cin >> num;
num2 = num;
num2 = num2 % 1001;
digit1 = num2 % 10;
num2 = num2 / 10;
digit2 = num2 % 10;
num2 = num2 / 10;
digit3 = num2 % 10;
num2 = num2 / 10;
digit4 = num2 % 10;
num2 = num2 / 10;
cout << "The sum of the number is: ";
cout << num2 << endl;

return 0;
}
its saying that all the digits is set but not used im new to programming.
may anyone please help me?
what is
"The sum of the number is: "
?
Topic archived. No new replies allowed.