Program to print 1
1 2
1 2 3
1 2 3 4 like that
Answer Posted / yagnik
public static void main(String args[]) throws
UnknownHostException, ClassNotFoundException
{
int count =5;
for(int i=1,h=5; i<count;i++){
for(int k=h;k>=0;k--)
{System.out.print(" ");}
for (int j=1 ;j<=i;j++){
System.out.print
(j);System.out.print(" ");
}
h--;System.out.println();
}
}
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
What is the use of flag?
What are synchronized blocks in java?
How many functional interfaces does java 8 have?
What does super keyword do?
How do you identify independent and dependent variables?
What is the use of default method in interface in java? Explain
Define reflection.
Which software is used for java programming?
What is the base class of all exception classes in java?
Why map is used in java?
What is rule of accessibility in java?
What does main method?
What are default methods ?
What is ascii code?
What does || || mean in math?