This is an old revision of the document!
-In order to obtain the last two digits of this input value, you can create a new variable and set that to be the result of the input year variable, divided by the integer division remainder (%) followed by 100. This is because a four-digit number, divided by 100 will yield a remainder in the tenth's place. This tenth's-place number will be what you are looking to use for the next steps in the project.
-For example: short unsigned int new = year % 100
subtract 2000 from the given year, and then divide by 4 using the “/” sign.
NOTE: Use () to ensure the code does things in the order you want.
Day | Value |
---|---|
Monday | 1 |
if statements are written as “if (condition){ the thing you want to happen }
If the condition is not met, “the thing you want to happen” is skipped over.
Operator | Description |
---|---|
== | is equal to |
To verify your results, ./mmf0verify
Remember to only use stdout to print the days of the week [EX: fprintf(stdout, “Monday\n”)]. If stdout is used for anything other than the days of the week, the mmf0verify will say you have a mismatch for every year, even if you get the correct day when you run your compiled code. If you want to print something other than the days of the week, use stderr.