+ 2
Bit some of programs are ended with getch()
2 Answers
+ 2
getch is a function that take character being entered and store it but some programs ends with it because programs like suppose a program to add two no.s shows a CMD window which asks enter the no.s we enter it the programs accepts it and then closes why because it does show result after input but after that it ends and the output persists for few microseconds so to avoid it we use getch it will show the result and wait for a input to be entered which we aren't using and does not close until it finds the character
0
getch () real need is to hold the output screen untill a key is entered from the keyboard
otherwise output will come in instant and we r unable to see the output