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
Post a Comment