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
Can we define private and protected modifiers for variables in interfaces?
What is the difference between double and float variables in java?
What is ++ a in java?
Is map sorted in java?
How to change the priority of thread or how to set priority of thread?
What is an exception? difference between Checked and Unchecked exception in Java
What is preflight request?
What is a constructor overloading in java?
How can you add and remove nodes in jtree?
What are checked exceptions?
please send me hr interview questions in it industry
What is the difference between static binding and dynamic binding?
What is the primary benefit of encapsulation?
What is a variable and constant?
How many bytes are a float?