+ 1
Write a program that print all the integers between 100 and 150 which are divisible by 8 in descending order.
Output: 144 136 128 120 112 104
4 Réponses
+ 4
The faster solution as above will be:
for(int i=150; i>=100; i--){
if(i%8 == 0){
System.out.println(i);
}
}
+ 1
You can loop it reverse. Simply do from 150 to 100.
0
But How do I decending order?