it won't work... the output i -81231231299 something...Code:while (day1 != day2) { total = (result * 400) + total; cout << total << endl; day1++; };
it won't work... the output i -81231231299 something...Code:while (day1 != day2) { total = (result * 400) + total; cout << total << endl; day1++; };
Manny Pacquiao once posted in his twitter:
It doesn't matter if the grammar is wrong, what matter is that you get the message
![]()
Some more explanation about your issue would be needed.
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.
![]()
Last edited by akhileshbc; Apr 16th, 2012 at 12:42 PM. Reason: "light bulb" - found another possibility of the reason for this issue :)
If my post was helpful to you, then express your gratitude using Rate this Post.
And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
My system: AMD Athlon X2 5200+, ASUS Motherboard, 2 GB RAM, 400 GB HDD, Nvidia 8600 GT 512MB, 19.5" TFT(Wide), Creative 5.1 Home Theater
Social Group: VBForums - Developers from India
Skills: PHP, MySQL, jQuery, VB.Net, VB6, Photoshop...
i found some syntax error in the upper part of my code.
thanks for the reply..![]()
Manny Pacquiao once posted in his twitter:
It doesn't matter if the grammar is wrong, what matter is that you get the message
![]()