V
Vasu
Hi anybody there!
Following is the output what I'm getting vs what I want, and below
that is the code snippet I've created. Can anybody help me find the
root of problem / solution for it. Thanks in advance
Test.java : Outcome
What I'm getting:
**
****
******
********
**********
************
**************
****************
**
********************
******************
****************
**************
************
**********
********
******
****
What I need it to be:
**
****
******
********
**********
************
**************
****************
********************
******************
****************
**************
************
**********
********
******
****
**
Here is the code I've used to create this figure :
for(k=0; k<10; k++){
while(i<10)
{
System.out.print(" ");
i++;
}
i=k;
while(j>0){
System.out.print("*");
j-=1;
}
while(l>0){
System.out.print("*");
l-=1;
}
System.out.println();
j=k;
l=k;
}
for(k=0; k<10; k++){
while(i>0)
{
System.out.print(" ");
i--;
}
i=k;
while(l<10){
System.out.print("*");
l+=1;
}
while(j<10){
System.out.print("*");
j+=1;
}
System.out.println();
j=k;
l=k;
}
Following is the output what I'm getting vs what I want, and below
that is the code snippet I've created. Can anybody help me find the
root of problem / solution for it. Thanks in advance
Test.java : Outcome
What I'm getting:
**
****
******
********
**********
************
**************
****************
**
********************
******************
****************
**************
************
**********
********
******
****
What I need it to be:
**
****
******
********
**********
************
**************
****************
********************
******************
****************
**************
************
**********
********
******
****
**
Here is the code I've used to create this figure :
for(k=0; k<10; k++){
while(i<10)
{
System.out.print(" ");
i++;
}
i=k;
while(j>0){
System.out.print("*");
j-=1;
}
while(l>0){
System.out.print("*");
l-=1;
}
System.out.println();
j=k;
l=k;
}
for(k=0; k<10; k++){
while(i>0)
{
System.out.print(" ");
i--;
}
i=k;
while(l<10){
System.out.print("*");
l+=1;
}
while(j<10){
System.out.print("*");
j+=1;
}
System.out.println();
j=k;
l=k;
}