I'd suggest looking at the documentation.
Using the standard C library you can easily create a program that reads characters until the user hits ENTER then processes them one by one. Have a look at getchar(), which exactly does that: reads input (sequence of characters) until the user presses ENTER.
Unfortunately, the C standard does not support checking if a key was hit, hence the above implementation (reading keys first, processing them later) is easy. For processing keys one by one, you need some platform specific libraries, such as
In general, it's a useful skill to be able to search the Internet and find what you're looking for.
With these functions you should be able to complete your assignment. And remember to keep checking the documentation. :)
One more link, that is useful from someone else's question on StackOverflow: https://stackoverflow.com/questions/20349585/c-library-function-to-check-the-keypress-from-keyboard-in-linux
Good luck!