conio.h in c,include ,#include in c

conio.h

conio.h in c header file used mostly by MS-DOS compilers to provide console input/output. It is not part of the C standard library

Syntax Of conio.h in c header file

#include<conio.h>
#include”conio.h”

C & c++ Header file

stdio.h – Input and Output Functions
conio.h – console input and output
math.h – Mathematics Functions
string.h – String Functions

It’s basically used in Turbo C++ IDE

conio.h in c functions:

clrscr()
delline()
getch()
getche()
gotoxy()
kbhit()
wherex()
wherey()
textcolor()
textbackground()

in c

Two important functions is

1.clrscr() – This is used to clear the previous output in the output window. If we don’t use it in our program then the output window will become messy.

2. getch()-This function is used to hold the output window, otherwise when you run your code it will display the output window for just a fraction of second. So, it is necessary to use it, if we want to hold our output screen.

Example Of conio.h header file


#include”stdio.h”
#include”conio.h”
main( ) {
clrscr();
int num ;
printf ( “Enter a number less than 10 ” ) ;
scanf ( “%d”, &num ) ;
if ( num <= 10 )
printf ( “What an obedient servant you are !” ) ;
getch();
}

Output

Enter a number less than 10
9
What an obedient servant you are !

What is the use of #include conio h in C++?

conio.h in C : #include is a preprocessor directive, used to paste the code Of given file to the current file. conio. h is a non-standerd header file, used mostly by MS Dos compilers like turbo c/c++ to provide console input/output.

What is the use of conio.h in C?

conio.h in C : #include is a preprocessor directive, used to paste the code Of given file to the current file. conio. h is a non-standerd header file, used mostly by MS Dos compilers like turbo c/c++ to provide console input/output.

What does conio.h in c stand for?

conio h is a C header file used mostly by MS-DOS compilers to provide console input/output.It stands for console input output header file.

Difference between stdio.h and conio.h

conio.h header file : conio means console input output. On compilation of the above code the compiler reports all errors due to the mismatch between parameters in function call and their corresponding prototypes declared in the file ‘conio.h’. You can even open this file and look at the prototypes. The stdio.h (stdio.h in c) header defines three variable types, several macros, and various functions for performing input and output. C functions in stdio.h file: Function Description printf() This function is used to print the character, string, float, integer, octal and hexadecimal values onto the output screen scanf() This function is used to read a character, string, numeric data from keyboard. getc() It reads character from file gets() It reads line from keyboard getchar() It reads character from keyboard puts() It writes line to o/p screen putchar()