this is the code that i did:
import javax.swing.JOptionPane;
public class MidtermExam {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
int x;
int y;
int z;
int count = Integer.parseInt(JOptionPane.showInputDialog(null,"Enter any Number:"));
for(x=1;x<=count;x++){
for(y=x;y<=count;y++){
System.out.print(x+"");
}
System.out.println();
}
}
}
it should output a triangle like this when i input 3:
1
2 2
3 3 3
but it doesnt and i dont know how to do that..please help thanks!