0

How to write a program in Java using any of loops to print Odd Numbers from 1 to 25.

How to write a program in Java using any of loops to print Odd Numbers from 1 to 25.Use any loop.

18th Apr 2019, 3:33 PM
Zain Ul Abdeen
Zain Ul Abdeen - avatar
3 odpowiedzi
+ 3
You can do it like this: for (int i = 1; i <= 25; i++) { if (i % 2 != 0) { System.out.println(i); } }
18th Apr 2019, 4:26 PM
JavaBobbo
JavaBobbo - avatar
18th Apr 2019, 4:22 PM
Aleksander Szczepura
Aleksander Szczepura - avatar
+ 1
I have told you
18th Apr 2019, 6:37 PM
Farrukh Shah
Farrukh Shah - avatar