Write a program that prints all the odd numbers from 25 to 1 (in decreasing order). | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Write a program that prints all the odd numbers from 25 to 1 (in decreasing order).

9th Apr 2021, 4:19 PM
VeNoM yT
VeNoM yT - avatar
2 Answers
+ 1
public class Program { public static void main(String[] args) { for (int i = 25; i>0; i--) { if (i%2==1) System.out.println(i); } } }
4th Nov 2022, 7:46 PM
Rony
Rony - avatar
0
Show as your code attempt
9th Apr 2021, 4:26 PM
Matias
Matias - avatar