Java Loops II

  • + 1 comment

    Why is a System.out.println(); added in the last. If I am remove it the code is not working. please help.

    • + 2 comments

      Because you need the other test case on a different line

      you want this!!

      2 6 14 30 62 126 254 510 1022 2046

      8 14 26 50 98

      you don't want this

      2 6 14 30 62 126 254 510 1022 2046 8 14 26 50 98

      • + 0 comments

        Thank you very much. I got it. You're awesome.

      • + 0 comments

        what will hapeen if we write System.out.println(a+" "); instead of System.out.print();