How do i recieve input and output for my program,do i use fstream or printf & scanf
It depends on the programming language you choose. scanf/printf or iostream are very common for c/c++ programs...
In addition to @daft_wullie's answer. Input comes on the stdin stream and output goes on the stdout stream.