java - javaBegginer - how to counts from 10 to 0 using while/do while -


i started learning java , can't solve this:

i want code program counting 10 0 using "do while" , show numbers 9 1. did this:

public class exwhile {       public static void main(string[] args) {                     int = 10;           {                     --a;               system.out.println(a);                          }    while (a==1);         }     } 

why wont working?

your loop saying "while equals 1" stuff. since isn't initialized 1, it's going through do-while loop once.

what want while(a != 0) or can while (a > 0) print 10 thru 0.


Comments

Popular posts from this blog

javascript - oscilloscope of speaker input stops rendering after a few seconds -

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -