Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Juana Fisher   on Nov 16 In Java Category.

  
Question Answered By: Allan Bailey   on Nov 16

Here is the code for that:

class NumberTriangle
{
public static void main(String[] args)
{
int i, j=0, k=0;
while(k<=15){
for(i=0;i<=k;i++)
{
System.out.print(" ");
}
for(i=0;i<=15-k;i++)
{
System.out.print(j+" ");
}
System.out.println();
k++;
j++;
if(j>9)
j=0;
}
}

}

Share: 

 

This Question has 6 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on how can u make a triangle Or get search suggestion and latest updates.


Tagged: