- 1
Java
what program that add all integer number from 1-20 except 11,12
7 odpowiedzi
+ 2
You could use a for-loop to add the number.
You could either check on each iteration if the current number is 11 or 12 and skip them if so. Or you add up all numbers to 20 and simply subtract 11 and 12 after the loop.
+ 2
Roo s If you are a beginner, a better approach would be to do the Java course. Just asking a lot of point questions, without learning the basic, won't help you much.
+ 1
Check by if statment or what sorry but I am begginer in java
+ 1
if(i == 11 || i == 12)
continue;
0
Yes, you can use the if-statement for checking.
0
Yeeees its work
Thank you All ❤️❤️
- 1
May you tell if my statment correct or not if(i=11 && i=12)
How I can told the program except them?