[Solved] Output row of Asterisks using a for-loop


Yes it is :-). You count from 0 to your value, right? So read your int before the loop and use the variable as the loop end condition:

Scanner input = new Scanner(System.in);
int num = input.nextInt();
for(int i =0; i<num; i++) {
      System.out.print("*");
}

solved Output row of Asterisks using a for-loop