Search Result

Collapse
2 results in 0.0014 seconds.
Keywords
Members
Tags
unreachable
  •  

  • Charles Sherman
    started a topic How to fix Unreachable Statements?
    in Java

    How to fix Unreachable Statements?

    Code:
    import java.util.Random;
    import TerminalIO.KeyboardReader;
     public class random
     {
      public static void main(String args[])
      {
      int guess;
      int answer;
      Random generator = new Random();
      KeyboardReader reader = new KeyboardReader(); 
      System.out.print("Enter Guess");
      guess = reader.readInt();
      answer = generator.nextInt(99+1);
      while(guess!=answer){
    ...
    See more | Go to post

  • Unreachable code in function main()! cannot make it work!

    I just started programming, and I followed a tutorial to make a calculator. Once I was done, I wanted to make it more advanced, so it wouldn't crash if I try to divide by 0, but instead not giving me the choice of dividing. I thought I was done, but then it simply just skipped the part where it actually shows the result. I tried to fix it, but now I get the calculator.cpp 58: Unreachable code in function main() error.
    This is my code. Anyone...
    See more | Go to post
    Last edited by DavidSS; Oct 24 '10, 12:58 PM. Reason: Found a solution
Working...