here is my code but i need to get output if my Sample input:
3
Sample output
*
***
*****
***
*
will must look like this! now can anyone please help me with this ..
public class p2.java{
public static void main (String args[]){
int x;
SimpleInput sInp = new SimpleInput();
x = sInp.getInt("please enter an Integer");
int y = 1;
char c='*';
char z=' ';
while(y<=x){
int n=x-y;
while(n>0){
System.out.print(z);
n--;
}
int k = 1;
while (k<=y){
System.out.print(c);
k++;
}
System.out.println(z);
y++;
}
}
}
i did this problem using simple input . so far this code work perfect but i just cant get my desire output !