Program to print 1
1 2
1 2 3
1 2 3 4 like that
Answer Posted / ravi jain
public class Test
{
public static void main(String[] args)
{
int sp=5;
for(int n=1;n<=5;n++)
{
for(int s=1;s<=sp;s++)
{
System.out.print(" ");
}
for(int i=1; i<=n;i++)
{
System.out.print(i+" ");
}
System.out.println();
sp--;
}
}
}
| Is This Answer Correct ? | 13 Yes | 1 No |
Post New Answer View All Answers
What is assembly condition codes?
What are the steps involved to create a bean?
What is the function of character?
Differentiate between array list and vector in java.
What is the difference between declaration and definition in java?
State the difference between strings and arrays.
What is a website container?
What is the difference between throw and throws keywords?
How is java created?
What is java regex?
What is compareto () in java?
java program with complete 4 oops concepts implemented example
How many types of constructors are used in java?
What is regex java?
Hi all, I am dng a mini project on FileSplitter application which splits the GBs of logfile into Smaller chunks(mbs) depending on the split size." How to handle GBs file? I am getting OutOfMemoryException, when I input such GB sized file. Thx