what is the function of getch() in c programming?
Join The Discussion
Comments (1)
Related User Ask Questions
Which of the following is not a primary function of a Bank?
A. Granting Loans
B. Collecting Cheques/Drafts customers
C. Facilitating import of goods
D. Issuing Bank Drafts
A. Regulatory jurisdictional fight between SEBI and IRDA
B. They don’t offer better tax benefits
C. They offer lesser returns compared to traditional insurance policies
D. All of the above
The Chameli Devi Jain Award is given for an outstanding woman ____?
A. Scientist
B. Reporter
C. Player
D. Teacher

It is a predefined function in "conio.h" (console input output header file) will tell to the console wait for some time until a key is hit given after running of program.
By using this function we can read a character directly from the keyboard. Generally getch() are placing at end of the program after printing the output on screen.
Example :
#include
#include
void main()
{
int a=10, b=20;
int sum=0;
clrscr();
sum=a+b;
printf("Sum: %d",s);
getch(); // use getch() befor end of main()
}
Output:
Sum: 30