• Post Reply Bookmark Topic Watch Topic
  • New Topic

Infinite for loop help  RSS feed

 
Sam Kluender
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I wrote a program that asks the user for their letter code to tell them where they are supposed to go. I was then told to comment out asking the user and to use a loop to print each possible destination. I decided to use a for loop and am stuck in an infinite loop. Any tips or helps?

Thanks!

 
Junilu Lacar
Sheriff
Posts: 11476
180
Android Debian Eclipse IDE IntelliJ IDE Java Linux Mac Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're stuck in the while loop on line 30 because (major != 'P') evaluates to true and that never changes
 
Oleksandr Mykhailov
Greenhorn
Posts: 9
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I agree with Junilu Lacar. I think you better change your to Hope this will help you.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!