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
How variables are stored in memory?
Can a method be static?
What are the practical benefits, if any, of importing a specific class rather than an entire package (e.g. Import java.net.* Versus import java.net.socket)?
What is array class in java?
Write a method that will remove given character from the string?
Do loops java?
What modifiers may be used with an inner class that is a member of an outer class in java programming?
How to split a string in java?
How many types of variables are there?
Can we have try block without catch block?
What is early binding and late binding in java?
Differentiate between the constructors and methods in java?
what is meant by HQL?
What is executor memory?
What does nextint () do in java?