I use this script to prepare for the exams. Given a file with questions like domande_bd.txt, the .txt file must have a question for each line.
This script prints the questions in the file on the screen
Compile question.c with
gcc question.c
Run a.out
./a.out <name of file whit question>