Java programming 用 while Loop

2011-05-27 8:02 am
Following output NO Odd numbers

5 1 3 5 10 1 3 5 7 915 1 3 5 7 9 11 13 15




有冇人知點用 while Loop ?

可以SD我EMAIL~
THX

回答 (2)

2011-05-27 6:02 pm
int n = 5;
int i = 1;
while (i <= n) {
System.out.println(i);
i += 2;
}
2011-05-27 9:36 am
Can you explain more what the program is suppose to do?

You said no add numbers but all the output numbers are odd numbers except

for the ten in the second line


收錄日期: 2021-04-13 18:01:18
原文連結 [永久失效]:
https://hk.answers.yahoo.com/question/index?qid=20110527000051KK00005

檢視 Wayback Machine 備份