UrbanPro

Learn C Language from the Best Tutors

  • Affordable fees
  • 1-1 or Group class
  • Flexible Timings
  • Verified Tutors

Search in

What is the use of getch(); in the end of c program

Asked by Last Modified  

Follow 5
Answer

Please enter your answer

Computer Geek

getch() is used to hold the console(output) window on the screen after the whole program run is completed till the user enters a key from keyboard. However, the character entered is not displayed on screen. For that you will have to use getche() function. Both functions are present in conio.h header...
Comments

Computer Programmer

getch() is used to hold the screen.It makes sure that you can see your output on the output screen.If you don't use getch() at the end of your c program then you won't be able to see the output of your program.
Comments

Professional Tutor with 15 years of experience.

Most of the c program end with this statement. So most of the people thought that this program is used to get output on the screen. But it is wrong This statement is used to read a single character from console without an echo to screen.. let see how it is.... When you run this...
read more
Most of the c program end with this statement. So most of the people thought that this program is used to get output on the screen. But it is wrong This statement is used to read a single character from console without an echo to screen.. let see how it is.... When you run this program using turbo c++ compiler we cannot see the output. Actually the out put was already printed on the screen , at the printing time itself the run window will close. When you go to the user screen (window --> user screen) , you can always see what the last status of program running. Here getch() helps to the user for waiting to enter a character from keyboard .. read less
Comments

Software Project Freelancer, Trainer

This function is used to get a character from your console like scanf.. Reason for using @ end of every program: normally your c program executes line by line. Your console window(where we see our output) will appear of scanf to get our input values.. also for writng our output in printf console...
read more
This function is used to get a character from your console like scanf.. Reason for using @ end of every program: normally your c program executes line by line. Your console window(where we see our output) will appear of scanf to get our input values.. also for writng our output in printf console willopen. See the console will not wait and show the final result(after executing final line of code). It completed or executed all the lines of code , so it will terminated. So if you are using this getch() at end of code, the console window will wait for getting input from you. So tht we can check the final ouput(provided you added getch at last line). Instead just use scanf() to read any value, thepurpose is to make console open untill we wish to close. Hope it helps..! read less
Comments

to read a character from screen.
Comments

Java Expert (Oracle Certified)

getch() is to get character. It waits to get a character in input from console. So apparently it is used to hold the screen so you can see the output. This can be used anywhere you want to get any character input from console.
Comments

Computer Languages Tutor

getch() is a library function which ask for a character to continue as whenever u pas getch() in your program it will wait on the same screen untill u pass a character to that
Comments

Tutor

It is hold the output result till press any key
Comments

We use getch() to: Get information from the program Clear console screen Show console screen Close the program
read more

We use getch() to:

  • Get information from the program
  • Clear console screen
  • Show console screen
  • Close the program
read less
1 Comments

Expert C/C++ Trainer with over 15 years of Experience

If you don't use getch , the control comes back to program editor window and we need to press alt+f5 to see output screen. To avoid this we use getch to make sure the program waits till you see result and press a key. It is not a good practice to use getch.
Comments

View 23 more Answers

Related Questions

What is the benefit of using enum to declare a constant?
ENUMS.. Can give numerical values for Sunday, Monday,... Easy to use in coding... Makes the program more readable/ understandable, than using 1,2,3.. Etc.
Sita
0 0
7
Basics of 'C'language
C is middle level language, using C you can write program which directly interact with the hardware like device driver programming or you can write GUI application. C is very powerful language compare...
Raghavendra
Is C#, C++, Python, or JS better for game development?
All languages good for gamjng. But you can make 3d games in c# uaing unity software and it's very very interesting to work on it.
Mohit
0 0
6
Can we pass arguments in the main function in C language?
Yes. it is possible to pass arguments into the main function.
Mukesh
0 0
7
What is the benefit of using an enum rather than a #define constant?
The use of an enumeration constant (enum) has many advantages over using the traditional symbolic constant style of #define. These advantages include a lower maintenance requirement, improved program readability,...
Basundhara
0 0
7

Now ask question in any of the 1000+ Categories, and get Answers from Tutors and Trainers on UrbanPro.com

Ask a Question

Related Lessons

Features Of C Language
Features of C language It is a robust language with rich set of built-in functions and operators that can be used to write any complex program. The C compiler combines the capabilities of an assembly...

C Language
To get help in C window (for keywords, functions) press Alt +F1.To delete a single line , use the shortcut key CTRL +Y.If you got error about the path when you execute a C pgm, check the Options menu =>Directories.
T

Thilagam S.

0 0
0

Basic Concepts of Web Designing
An introduction to domain names, web servers, and website hosting 1)What is the web? In a nutshell, the web is a whole bunch of interconnected computers talking to one another. The computers (on the...

How to write shared library program using C Programming?
Library Name : hellofilename : hello.c#include void Hello(){ printf("Hello World .. How are you 1\n");}======================================Header File:hello.h#ifndef __HELLO_H#define __HELLO_Hvoid Hello(void);#endif===============================Application...

Design your own Mouse Driver in C Language
Mouse Driver (msdrv.h) #include #include union REGS i,o; restrictmouseptr(int x1, int y1, int x2, int y2) { i.x.ax=7; i.x.cx=x1; i.x.dx=x2; ...

Recommended Articles

Lasya Infotech is a Hyderabad based IT training institute founded in 2016 by O Venkat. Believing in his innovation, passion and persistence and with a diverse blend of experience, he started his brainchild to deliver exemplary professional courses to aspiring candidates by honing their skills. Ever since the institute envisions...

Read full article >

Brilliant Academy is one of the reputed institutes for B.Tech tuition classes. This institute is specialised in delivering quality tuition classes for B.E, Engineering - all streams and Engineering diploma courses. Incorporated in 2012, Brillant Academy is a brainchild of Mr Jagadeesh. The main motto of the academy is to...

Read full article >

Whether it was the Internet Era of 90s or the Big Data Era of today, Information Technology (IT) has given birth to several lucrative career options for many. Though there will not be a “significant" increase in demand for IT professionals in 2014 as compared to 2013, a “steady” demand for IT professionals is rest assured...

Read full article >

Microsoft Excel is an electronic spreadsheet tool which is commonly used for financial and statistical data processing. It has been developed by Microsoft and forms a major component of the widely used Microsoft Office. From individual users to the top IT companies, Excel is used worldwide. Excel is one of the most important...

Read full article >

Looking for C Language Classes?

Learn from the Best Tutors on UrbanPro

Are you a Tutor or Training Institute?

Join UrbanPro Today to find students near you
X

Looking for C Language Classes?

The best tutors for C Language Classes are on UrbanPro

  • Select the best Tutor
  • Book & Attend a Free Demo
  • Pay and start Learning

Learn C Language with the Best Tutors

The best Tutors for C Language Classes are on UrbanPro

This website uses cookies

We use cookies to improve user experience. Choose what cookies you allow us to use. You can read more about our Cookie Policy in our Privacy Policy

Accept All
Decline All

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 55 lakh students rely on UrbanPro.com, to fulfill their learning requirements across 1,000+ categories. Using UrbanPro.com, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 7.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on UrbanPro.com. Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more