The program successfully adds two integers and prints the result. However, the absence of getch(); causes the console window to close immediately in some environments, preventing users from seeing the output.
Why the Issue Needs to Be Fixed: Without getch();, users may not be able to view the program’s output before the window closes, especially when using Turbo C or similar compilers. Adding getch(); ensures the output remains visible until the user presses a key.
How to Reproduce (For Bugs):
-Compile and run the program using Turbo C or Dev-C++.
-Observe that the console window closes immediately after execution.
Other Notes & Environmental Info
OS: Windows
Compiler: Turbo C / Dev-C++
Version: Any version that supports conio.h
Suggested Fix: Add getch(); before the closing } to keep the output window open.
The program successfully adds two integers and prints the result. However, the absence of getch(); causes the console window to close immediately in some environments, preventing users from seeing the output.
Why the Issue Needs to Be Fixed: Without getch();, users may not be able to view the program’s output before the window closes, especially when using Turbo C or similar compilers. Adding getch(); ensures the output remains visible until the user presses a key.
How to Reproduce (For Bugs):
-Compile and run the program using Turbo C or Dev-C++.
-Observe that the console window closes immediately after execution.
Other Notes & Environmental Info
OS: Windows
Compiler: Turbo C / Dev-C++
Version: Any version that supports conio.h
Suggested Fix: Add getch(); before the closing } to keep the output window open.