Loops - While Loop | Java Series | Madhu Educational Academy

preview_player
Показать описание
#javacodes #java #codesnippets #coding #trending #javaseries

Loops - While Loop:
-------------------------------
Program: Print numbers from 1 to 5 using a while loop.
-----------------------------------------------------------------------------------------
public class WhileLoopExample {
public static void main(String[] args) {
int i = 1;
while (i [lessthansymbol]= 5) {
i++;
}
}
}

Output:
-------------
1
2
3
4
5

© 2024 | Madhu Educational Academy
Рекомендации по теме