Computer problems,Computer help
*AX SOFT>>>Programming & Design

Java, nested loop?


How can I output:

1 2 3 4
聽聽聽 2 3 4
聽聽聽聽 聽 3 4
聽聽聽聽聽 聽 聽 4

? Thanks in advance!

for (int c=1;c<=4;c++)
{

for (int i=c;i<=4;i++)
{
System.out.println(i);
}

}

for (int c=1;c<=4;c++)
{
for(int j=1;j<=c-1;j++)
{if (c==1) continue;
System.out.print(" ");
}

for (int i=c;i<=4;i++)
{
System.out.println(i);
}

}

Tags
  General - Computers & Internet   Software   Security   Programming & Design   Facebook   Flickr   Google   MSN   MySpace
Related information
  • I need help to create a program to put a string backwards with an array and a function?

    Not sure what language, but in pseudo code.... I assume you have an array that contains Strings. 1) Loop through the array creating a temporary string variable for each word in your array. &...

  • Vista slow boot with black screen?

    mines does the same. nothing wrong with that at least it doesn't have some Major virus!

    ...
  • Is there a visual basic for Mac? Or something Similar?

    i like java. the syntax is similar to visual basic in most respects, and it works on all computers not just ms windows. eclipse is an awesome development platform for java and works great on os...

  • Setting up mysql on godaddy?

    no.. you do not need to download mysql. they have it installed for you. set your database up on their site.

    ...
  • Tell me this?

    I suggest joining the yahoo mailing list over here . ...

  • How can I tell if I have php gd installed with phpinfo on php 5.1.6?

    When installed it will show a section for GD with all the options and which ones are enabled / disabled. Perhaps you host has installed GD but forgot to recompile PHP with GD support.

    ...
  • How can I publish my website from Dreamweaver?

    I'm telling you that purchased templates are evil, a pain in the butt, and not worth the time. I'm not saying this from a designer standpoint but when I was working for a company they had...

  • How do you make flash games?

    Adobe flash professional, macromedia director.... Here is a site that has tutorials that might help you: ...

  •  

    Categories--Copyright/IP Policy--Contact Webmaster