Control flow statements are fundamental components of programming languages that allow developers to control the order in which instructions are executed in a program. They enable execution of a block of code multiple times, execute a block of code based on conditions, terminate or skip the execution of certain lines of code, etc.
package day1;
public class While_basic {
public static void main(String[] args) {
// TODO Auto-generated method stub
int count = 1;
while(count<=5)
{
System.out.println(count);
count=count+1;
}
}
}
out put ---
1
2
3
4
5
Top comments (0)