hi,I got a text file,sample of it is below:

dog cat art
cat dog
art


I would like to write a program,to read the file and print out the words,one by one.So the output would be:

dog
cat
art
cat
dog
art

What command to use?I tried to use fgets and fscanf without much sucess.Any guide provided would be much appreciated.
Thanks-Rahul