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
Explain all java features with real time examples
What is java developer skills?
what is object-oriented programming in java?
What does exclamation mean in java?
Difference between string s= new string (); and string s = "abv";?
What are the different types of data structures in java?
What is the difference between numeric and integer?
What are the super most classes for all the streams?
What is basic syntax?
Which method cannot be overridden in java?
Can we define constructor in inner class?
What is tostring () method?
Can you override private or static method in java?
What is argument in java?
What is meant by method?