I'm making a program that tells the day of the week for any date in the past or future. In order to split the 4-digit year into the first 2 numbers for century and last 2 numbers for year in order for the formula to work right I used the following 2 lines of code: Int y = yANDc / 100; Int c = yANDc % 100;
The problem is when I display the final output. If they typed in a 4-digit year between "xx00" and "xx09", it chops off any preceding "0"s. So, if they entered "2009", the final output would be written as "209".
Any ideas on how to fix this and format it to where it doesn't drop preceding "0"s?