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
Are arrays dynamic in java?
Can we declare array without size in java?
What is equlas() and hashcode() contract in java? Where does it used?
what is synchronization and why is it important? : Java thread
Is map ordered in java?
Write java program to reverse string without using api?
What data structures are used to perform recursion?
What are nested classes in java?
Explain the difference between throw and throws in java?
What is the flag in java?
what is a green thread? : Java thread
Can there be an abstract method without an abstract class?
Is finalize() similar to a destructor?
What is __ init __ functions?
What is e java?