DEV Community

hema latha
hema latha

Posted on

While loop task

public class Task5 {

public static void main(String[] args) {
// TODO Auto-generated method stub
int no = 12345;
int count = 1;

while(5>=count)
{
System.out.println(no);
count = count+1;

}
}

out put --
12345
12345
12345
12345
12345

Next Task ---

public class Task6 {

public static void main(String[] args) {
    // TODO Auto-generated method stub
 int no=10101;
 int count = 1;
 while(5>=count)
    {
        System.out.println(no);
        count = count+1;
    }
}
Enter fullscreen mode Exit fullscreen mode

}
out put --
10101
10101
10101
10101
10101

Top comments (0)