Name: _____________________________________________ Alpha: ___________________
Describe help received: ________________________________________________________
- Due before class on Wednesday, February 8
- This homework contains code to be submitted electronically.
Put your code in a folder called
hw12and submit using the
- This is an electronic homework and you do not need to print out anything to turn in during class.
- Required reading: Sections 3 (Pointers) and 4 (fscanf) from the Unit 4 notes,
Write a program called
age.cthat reads a name and a birthday such as "
Philip 1/31/1937" and prints out a line with their age as of February 6, 2017, for example "
Philip is 80 years old."
Philip is 80 years old.
Steve is 80 years old.
You must use a
fscanfstatement to read in the input line! Note that someone born on February 6 would be considered to have their birthday already, so someone born on 2/7/2016 would be
0 years oldwhile someone born on 2/6/2016 would be
1 years old.