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
Does google use java?
What are functions in java?
Can we force garbage collector to run ?
What is meant by object oriented programming – oop?
What is boolean strategy?
What is ternary operator?
What is a function easy definition?
What is Enum in Java?
What are the advantages and disadvantages of object cloning?
Does garbage collection occur in permanent generation space in jvm?
Why set is used in java?
How do you find the absolute value?
What is scope & storage allocation of global and extern variables? Explain with an example
Explain inner classes ?
What is the difference between a method and a function in alice?