There is a bug when you try to run in terminal, it does not take any input or output.
To fix this bug on Ubunut,
Tools --> Options --> Environment --> General
Change the Terminal from
x-terminal-emulator -e
to
/usr/bin/xterm -e
Thanks to https://bugs.launchpad.net/ubuntu/+source/qtcreator/+bug/566387