/* * age1.c * By John Stile * Chapter2 * Ask use for the year they were born * Capture the users entery and store it as an integer variable. * Tell the user what year they entered */ #include // include functions in library stdio.h when compiling this code. int main(void) // header for function birthyear, takes nothing, returns int { int birthdate; // declare variable birthdate printf(" What year where you born? (i.e 1969 )"); // Ask user for the year scanf( "%d", &birthdate); printf("You entered %d\n", birthdate); // print the value stored in birth printf("You are %d years old\n", 2007-birthdate); // calculate and print users age return 0; }