0
Can anyone tell me how this code works
import java.util.Scanner; public class Program { public static void main(String[] args) { System.out.println ("Type in your name and then your favourite number."); Scanner input = new Scanner(System.in); String name = input.nextLine(); int favNumber = input.nextInt(); int x=0; while (x < favNumber) { System.out.println(name + "hi"); x++; } } }
4 Answers
+ 5
hi! do you not understand the whole code or some part of it?
+ 2
Please put Java in post tags for relevant language context clarity.
https://code.sololearn.com/W3uiji9X28C1/?ref=app
0
Were you the one that write the code?
0
whole code