I feel a little embarrassed to ask, due to the simplicity of the problem, yet my code isn't working and I can't figure out why. It's printing the opposite of what I want it to print. I ask it to print a string 4 times, it prints it 2 times, and vice-versa. Can anyone help me. Thank you!
package en.codegym.task.pro.task04.task0414;
import java.util.Scanner;
public class Solution
{
public static void main(String[] args)
{
Scanner input = new Scanner(System.in);
String a = input.nextLine();
int b = input.nextInt();
do
{
System.out.println(a);
b++;
}
while (b >= 0 && b <= 5);
}
}