So this is part of a much larger part of code obviously. What I am having problems with is when I run it and the first if statement is true then my program does nothing further. Eyear is an int for ending year, syear is an int for starting year and byear is an int for between year. The program is supposed to go on and use the value for days to make a calculation.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
if (eyear - syear >= 2)
{
byear = eyear - 1;
while (byear - 1 >= syear
{
if (byear % 4 != 0)
days = days + 365;
if ((byear % 100 == 0) && (byear % 400 != 0))
days = days + 365;
if (( byear % 4 == 0) || (byear % 400 == 0))
days = days + 366;
byear--;
}
{