Make a program which displays a different message depending on the age given. Here are the possible responses:
You will need to use a function. In main()
,
input the name and age. Then pass the age to a function called
display_age_message(
,
which should have int
age )if
(and else if
) statements
inside it to display a single message.
How old are you? 17 You can't vote.
©2013 Graham Mitchell
This assignment is licensed under a
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 United States License.