Time Calculator

i keep getting errors when i compile my program but i dont know how to fix it..
can somebody help me please?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
  int sec_perMinute = 60,
            sec_perHour = 3600,
            sec_perDay = 86400,
            seconds;
    
    if ( cin >> seconds && seconds > 0 )
    {
        const int days = seconds/sec_perDay;
        if( seconds >= sec_perDay)
        {
            seconds =+%sec_perDay;
            cout << "days : "<< days << endl;
            cout << "seconds : "<< seconds;
            
        }
        else if ( seconds >= sec_perHour)
        {
            const int hours = seconds/sec_perHour;
            seconds =+%sec_perHour;
            cout << "hours : " << hours << endl;
            cout << "seconds :" << seconds << endl;
        }
        else if ( seconds >= sec_perMinute)
        {
            const int minutes = seconds/sec_perMinute;
            seconds =+%sec_perMinute;
            cout << "minutes :"<< minutes << endl;
            cout << "seconds :"<< seconds << endl;
        }
        else
        {
            cout << "that is not a valid number"<< endl;
        }
    }
And the errors are...??
main.cpp:46: error: expected primary-expression before '%' token..
Lines 11, 19, and 26 are not syntactically valid. What are you trying to do?
lets say a user inputs 90,000. the program will calculate and display the number of days using the number of seconds and then display the remaining seconds.
Topic archived. No new replies allowed.