Help code


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Help code

  1. #1
    Lindsey Guest

    Help code


    for (int Num = 0; Num < Max2; Num ++){
    System.out.println (Num);
    Place++;
    Mult++;
    for (int Num2 = Num + 1; Num2 < Max; Num2 ++ ){
    System.out.print (Num2);
    if (Num2 >= Place)
    break;
    }
    }






    OUTPUT output i want....
    1234567891011121314151617181 123456789
    234567891011121314151617182 2468101214
    34567891011121314151617183 36912141618
    4567891011121314151617184 so on....
    567891011121314151617185 (As you can see i'm way off)
    67891011121314151617186
    7891011121314151617187
    891011121314151617188
    9101112131415161718

  2. #2
    Uri Agassi Guest

    Re: Help code

    for (int Num = 0; Num < Max2; Num ++){

    // System.out.println (Num);

    Place++;

    Mult++;

    for (int Num2 = Num; Num2 < Max; Num2+=Num ){

    System.out.print (Num2);

    if (Num2 >= Place)

    break;

    }

    System.out.println();

    }



    Hope this answers your problem...

    "Lindsey" <Zave4@aol.com> wrote in message news:3a86bcb4$1@news.devx.com...
    >
    > for (int Num = 0; Num < Max2; Num ++){
    > System.out.println (Num);
    > Place++;
    > Mult++;
    > for (int Num2 = Num + 1; Num2 < Max; Num2 ++ ){
    > System.out.print (Num2);
    > if (Num2 >= Place)
    > break;
    > }
    > }
    >
    >
    >
    >
    >
    >
    > OUTPUT output i want....
    > 1234567891011121314151617181 123456789
    > 234567891011121314151617182 2468101214
    > 34567891011121314151617183 36912141618
    > 4567891011121314151617184 so on....
    > 567891011121314151617185 (As you can see i'm way off)
    > 67891011121314151617186
    > 7891011121314151617187
    > 891011121314151617188
    > 9101112131415161718




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center