DEV Community

hema latha
hema latha

Posted on

control flow statement ?

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.
Enter fullscreen mode Exit fullscreen mode

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;
    }
}
Enter fullscreen mode Exit fullscreen mode

}

out put ---
1
2
3
4
5

Top comments (0)