

Function Declaration: int cputs (const char *str) Example: int main(void) It does not convert newline character (\n) into combination of carriage – return (\r) and new-line character (\n). The carriage-return and newline characters are not appended to the string. Use this function to print a string of characters on the output screen. Printf("\n Entered characters: \"%s\"\n",p) Function Declaration: char* cgets(char* str) Example: int main(void) The cgets() function replaces CR/LF with the null terminator (\0) at the end of the string. This function reads characters until it encounters carriage-return (CR) and linefeed (LF). Use this function to read a string of characters from the console. Function Declaration: int putch (int c) Example: int main() This function prints only one character at a time on output window. Use this function to print information in the output window. The only difference is that this function also prints the value entered by the user in the output window. This function is similar to getch() function. The getch() is a non-standard function provided by conio.h whereas getchar() is a standard c library function. If you don’t use this function then the output screen closes within a fraction of a second. This function is also used to hold the output screen until the user enters any character. Use this function to read characters from the keyboard. Read also: 50 most commonly used Turbo C++ keyboard shortcuts getch(): Printf("The previous screen is now cleared.\n") Message on the screen after clearing the previous message Printf("Press any key to clear the screen") During the code execution, if you want to clear the existing printed information on the output console then you can use clrscr() function.

On the command prompt, we usually print code execution status, error information, and output results. Using this function you can clear the output command window. textbackground() conio.h header file functions: clrscr():
