Classwork 5 - UMBC-CMSC104/General GitHub Wiki
In today's classwork, we're going to be practicing writing functions. Name your source file even.c.
The goal today is to write a program that tells if a number is:
- Even
- Singly even -- A singly even number is a number N such that N % 4 == 2.
- Doubly even -- A doubly even number is a number N such that N % 4 == 0.
Your output should look something like this:
Please enter a number: 8
8 is even!
8 is not singly even!
8 is doubly even!
And
Please enter a number: 3
3 is odd!
3 is not singly even!
3 is not doubly even!
The code for evenness, singly evenness, and doubly evenness should each be its own function. In other words, your program should have a minimum of three functions. Each function should do the required calculation and then print out the result.
To submit:
submit cs104_wilson cw05 even.c
Notes
- None of the functions need to have a return value, since you're doing all of the printing in the function
- Each function will have to take at least one argument
- Use the function example as a reference.