Program to output as below formate:
1
2 3
4 5 6
7 8 9 10
Answer Posted / jyoti
public class format {
public static void main(String args[])
{
int k=1;
for(int i=0;i<5;i++)
{
for(int j=0;j<i;j++)
{
System.out.print(k++ + " ");
}
System.out.print("\n");
}
}
}
| Is This Answer Correct ? | 15 Yes | 3 No |
Post New Answer View All Answers
Wha is the output from system.out.println(“hello”+null); ?
what is the difference between Object Based Language and Object Oriented Language?
How to declare an arraylist in java?
What occurs when an object is constructed?
What are the differences between heap and stack memory?
how we can make a write-only class in java?
What are the difference between string, string builder, and string buffer in java?
Explain, java is compatible with all servers but not all browsers?
Name few "optional" classes introduced with java 8 ?
What is difference between array and vector?
How is the marker interface used in Java?
What is the maximum size of list in java?
Can we split string with in java?
What is unicode with example?
What is the intersection and union methods?