if i want want to print "hello" or any other string generally we use printf statement in c-language.But i want to know ,can we print a string on out put console witout using printf statement
Printf() is what is typically used from the Standard C Library. However, if you need to make a non-standard call, there are usually operating system specific functions to accomplish native I/O. Printf() is portable but other calls won’t be cross-platform.
If you’re writing in terms of Unix, take a look at the Curses Library (see links below). Using curses, programmers are able to write text-based applications without writing directly for any specific terminal type. The curses library on the executing system sends the correct control characters based on the terminal type. It provides an abstraction of one or more windows that maps onto the terminal screen. Each window is represented by a character matrix. The programmer sets up each window to look as they want the display to look, and then tells the curses package to update the screen. The library determines a minimal set of changes needed to update the display and then executes these using the terminal’s specific capabilities and control sequences.
For the DOS console, you’d most likely make BIOS calls (interrupt 10h) which printf() eventually ends up executing. If you have a Windows-based system, there is always DirectX or OpenGL…
For completeness, I should mention that on some machines, there is memory-mapped I/O for the video hardware. Therefore, you could determine the method to address the video hardware directly assuming the OS allows it (without writing your own device driver). You’d need to be much more specific with your question to determine if this is what you’re seeking.
Note: tadds, you’re supplying C++ code (Stream I/O) instead of the requested C-only advise.