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 binary tree in java?
What is a static method in java?
What is equals method in java?
What is difference between call by value and call by reference?
Define how can we find the actual size of an object on the heap?
What is int argc char * argv?
How do you read a char in java?
Can a class be private?
Can a class have 2 constructors?
Is 64bit faster than 32 bit?
How does multithreading take place on a computer with a single cpu in java programming?
what is comparable and comparator interface?
Explain the importance of finally over return statement?
What is the difference between sop and work instruction?
What is the properties class?