Results 1 to 1 of 1
  1. #1
    jude113 is offline Member
    Join Date
    Mar 2009
    Posts
    2
    Rep Power
    0

    Default [HELP]Java loops

    lets say height is = 5

    int height;
    int x,y;

    System.out.print("enter height: ");
    height=SavitchIn.readLineIn();

    for(x=1;x<=height;++x)
    for(y=1;y<=x;++y)

    if (y==x)
    System.out.println("I");

    else
    System.out.print("I");


    this is the output of that thing...

    I
    II
    III
    IIII
    IIIII



    but how about this one...
    u may find it funny but can u make me a java script that will print this thing...
    my teacher told me to make a java script using JCREATOR that will have an output just like this...
    the number of I and dots will be based in the height given..


    ....I
    ...II
    ..III
    .IIII
    IIIII

    badly need it :C
    Last edited by jude113; 03-06-2009 at 03:20 AM.

Similar Threads

  1. Replies: 16
    Last Post: 12-09-2008, 02:05 AM
  2. Question about loops
    By BHCluster in forum New To Java
    Replies: 4
    Last Post: 04-16-2008, 05:40 PM
  3. [SOLVED] Need help with Loops...please!
    By Zebra in forum New To Java
    Replies: 5
    Last Post: 04-10-2008, 01:44 PM
  4. Loops (while do etc)
    By manupr in forum New To Java
    Replies: 1
    Last Post: 01-15-2008, 03:59 AM
  5. Help me: loops in java
    By silvia in forum New To Java
    Replies: 3
    Last Post: 07-19-2007, 06:47 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •