how to print the below in java?thanks in advance....
*
* *
* *
* *
*
Answer Posted / jitendra
for(i=1;i<=3;i++)
{
for(j=3;j>=i;j--)
System.out.printf(" ");
System.out.printf("*");
for(j=1;j<2+i;j++)
System.out.printf(" ");
System.out.printf("*");
System.out.printf("\n");
}
this is to print
*
* *
* *
now apply ur brain to print the rest...
any problem ..then mail me
jitendrasharma13@gmail.com
Is This Answer Correct ? | 2 Yes | 6 No |
Post New Answer View All Answers
Explain static nested classes ?
What is the differences between c++ and java? Explain
What are constructors in java?
Can we sort a map in java?
Can we extend a class with private constructor?
What is a get method?
Explain about member inner classes?
What is a class component?
What is concurrent hashmap and its features?
Difference between this() and super() in java ?
What is the difference between exception and error in java?
Does a class inherit the constructors of its superclass in java programming?
Define nashorn in java8.
Does java map allow duplicates?
What is multiple inheritance? Is it supported by java?