it won't work... the output i -81231231299 something...Code:while (day1 != day2)
{
total = (result * 400) + total;
cout << total << endl;
day1++;
};
Printable View
it won't work... the output i -81231231299 something...Code:while (day1 != day2)
{
total = (result * 400) + total;
cout << total << endl;
day1++;
};
Some more explanation about your issue would be needed. :)
:wave:
Edit:
Have you set total as 0 before entering the loop ? Otherwise if you have just declared the variable (without assigning 0 as value) and summed value to it, then it might give you unexpected values as output. Because the compiler would assign a garbage value for that variable, if you don't assign anything.
:wave:
i found some syntax error in the upper part of my code.
thanks for the reply.. :D