Skip to content
Advertisement

How to print number 1 to 10(in that sequence only)using loops(java) if int i = 10

Output must be 1 2 3 4 5 6 7 8 9 10

I have tried While loop but it prints from 10 to 1

Advertisement

Answer

Assuming you must use i with an initial value of 10.

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement