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
What is the format specifier?
Which collections are thread safe in java?
How can I right-justify a string?
when to use ArrayList and when to use HashMap in webApplication.
What does split function do in java?
What are the important features of Java 8 release?
What is the difference between an interface and an abstract class?
How is string stored in java?
What is concurrent hashmap and its features?
Is an empty arraylist null?
What do you meant by active and passive objects?
What technique can be employed to compare two strings?
Differentiate between run time error and syntax error.
What exactly is a .class file?
What does percent mean in java?