Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I'm a beginner programmer... I have a question

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I'm writing a program that generates pythagorean triples for a summer project in math. I have a problem however... the main loop repeats indefinitly so that the user can continue to generate pythagorean triples, but I want the user to have the ability to break the loop and exit the program at any time by pressing a certain key, such as the "~" for example. How can I do this so that the main loop can still repeat but the user can exit at any time? What can I do so that the rest of the commands can still be carried out, but the program will be checking for the user to hit the ~ key the entire time?? Is this even possible? Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top