cout << "It takes " << time << " minutes to travel "
<< distance << " miles at "
<< speed << " miles per hour" << endl;
int char;
return 0;
}
What do I need to include in this program in order to keep it from closing after getting the result? Someone suggested getch, but the compiler says the file does not exist... :?:

>to pause a program just put the header conio.h
conio.h is not a standard header, and on top of that it isn't the correct header to do what you're suggesting.

>system("pause");
system is declared in stdlib.h. But it's a bad idea in general to use system for things like this because it's not portable (the argument will be different on different systems), it's unsafe ("pause" could be a malicious program), and it's slow because it calls the system command interpreter. The same goes for "cls". Your suggestion if implemented correctly will only work on Windows and DOS machines. You should strive for portability wherever possible, and choose the best nonportable option when you can. system is not the best nonportable option.