Program to print 1
1 2
1 2 3
1 2 3 4 like that
Answer Posted / sunil pradhan
public class program1 {
public static void main(String[] args){
for(int i = 1; i<=5 ;i++){
for(int k = 1; k<=i; k++){
System.out.print(k);
}
System.out.println("\n");
}
}
}
Is This Answer Correct ? | 6 Yes | 2 No |
Post New Answer View All Answers
What is a flag variable?
Difference between comparator and comparable in java?
What is n in java?
Why convert an applet to an application?
Explain about object oriented programming and its features?
What is run time allocation?
Can a class extends itself in java?
Explain java heap space and garbage collection?
Write a program in java to find the maximum and minimum value node from a circular linked list.
How finally used under exception handling?
What do you mean by local class?
How variables are declared?
How many types of interfaces are there?
How to sort array of 0 and 1 in java?
Can we have try without catch block?