samedi 30 juillet 2022

Java program to display number pattern

Please write a Java program to display the following output using for control statement. Your code shall acquire the user to input a single digit number between 0 till 2 via window and the output should look like the outputs shown below. If the user keyed in more than a digit or other than 0/1 or 2, prompt an error message and urge the user to key in the digit again. You are encouraged to use exception handling. 0
101 21012 3210123 432101234
or 0 000 00000 0000000 000000000 or 0 202 42024 6420246 864202468

Aucun commentaire:

Enregistrer un commentaire