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

Why string is a class?

538


What is the difference between numeric and integer?

507


What is charat ()?

525


what are the methods in object?

623


Is null in java?

546






Why is java so important?

643


What is bom encoding?

544


Write a program to find the whether a number is an Armstrong number or not?

569


Is assembly language a low level language?

488


These static constructors are correct ? class A { statc intA() { } static A(int x,int y) { } static A(int x) { } }

593


How do you find the independent variable?

502


What is google full form?

530


Explain the difference between throw and throws in java?

540


Can memory leak in java?

574


What is a lambda expression ? What's its use ?

558