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 parameter used for?
How does sublist works in java?
How to instantiate member inner class?
Why super is first line in java?
why doesn't java run on all platforms?
What does string [] args mean?
Is java se free?
Why wait and notify methods are declared in object class?
Are primitives objects?
What is the base class of all exception classes?
Can a final variable be initialized in constructor?
why java does not support unsigned keyword?
what is nested class in java?
Is it possible to use Semaphore/ Mutex in an Interrupt Handler?
Is cout buffered?