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
How do you declare an array in java?
What is the difference between yield() and sleep()?
What is the difference between dom and sax parser in java?
How do you sort arrays in java?
What is the main difference between java platform and other platforms?
What is ternary operator?
What is the right data type to represent a price in java?
What is a copy constructor in java?
How do you declare a destructor in java?
Can we call a non-static method from inside a static method?
What is array pointers ?
What is the functionality of the stub?
What does java edition mean?
What is an argument in java?
What is type inference in java8?