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
Tell some latest versions in JAVA related areas?
What is the difference between a scrollbar and a scrollpane?
Can we use return in constructor?
How many threads does a core java have?
How to change the priority of thread or how to set the priority of thread?
Give me example of derived data types.
Which method you will use to create a new file to store some log data. Each time a new log entry is necessary, write string to the file in java ?
Is java still necessary?
What is the difference between and ?
How to optimize the javac output?
What is an exception? difference between Checked and Unchecked exception in Java
Explain access modifiers in java.
What is the string function?
What is linked hashset and its features?
What is a singleton class in Java?