I have tested your program and it works fine.
Please give some more information about the hardware you are runing on and the project properties.
Some things you could try in the meanwhile:
1. check the system.h file for the uart baud rate and make sure it matches the terminals baud rate.
2. have a clean start for your project coming from the "hello_world" example provided by altera. just replace the main() function with your code and only include stdio.h and unistd.h, these are the only header files you will need.
hope this will help,
--wolf