Hey there...i was wondering if someone can help me with my program. I'm doing the leap year program thing. i thought i had it all figured out, but it ALWAYS says that it's not a leap year. here's my code...if you can help i'd gladly appreciate it.
int year, test4, test100, test400;
printf("The amazing leap year teller thingie thing!!!\nPleas e enter the year to be tested: ");
scanf("year");
test4 = year%4;
test100 = year%100;
test400 = year%400;
if((test4 == 0 && test100 != 0) || test400 == 0)
printf("DING!! Leap Year");
else
printf("ERROR! You have not chosen a leap year.\nPlease try again.\n", year);
system("pause") ;
return 0;
}
thanks!
int year, test4, test100, test400;
printf("The amazing leap year teller thingie thing!!!\nPleas e enter the year to be tested: ");
scanf("year");
test4 = year%4;
test100 = year%100;
test400 = year%400;
if((test4 == 0 && test100 != 0) || test400 == 0)
printf("DING!! Leap Year");
else
printf("ERROR! You have not chosen a leap year.\nPlease try again.\n", year);
system("pause") ;
return 0;
}
thanks!
Comment