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


Please Help Members By Posting Answers For Below Questions

What is the format specifier?

518


Which collections are thread safe in java?

483


How can I right-justify a string?

629


when to use ArrayList and when to use HashMap in webApplication.

3892


What does split function do in java?

539






What are the important features of Java 8 release?

582


What is the difference between an interface and an abstract class?

544


How is string stored in java?

564


What is concurrent hashmap and its features?

530


Is an empty arraylist null?

603


What do you meant by active and passive objects?

613


What technique can be employed to compare two strings?

578


Differentiate between run time error and syntax error.

575


What exactly is a .class file?

581


What does percent mean in java?

592