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++; } } }

24th Oct 2022, 7:14 AM
Madham Muni Siva Raghava
Madham Muni Siva Raghava - avatar
4 Answers
+ 5
hi! do you not understand the whole code or some part of it?
24th Oct 2022, 7:42 AM
Yaroslav Vernigora
Yaroslav Vernigora - avatar
+ 2
Please put Java in post tags for relevant language context clarity. https://code.sololearn.com/W3uiji9X28C1/?ref=app
24th Oct 2022, 1:32 PM
Ipang
0
Were you the one that write the code?
25th Oct 2022, 12:50 PM
Abdulbasit Y Morai
Abdulbasit Y Morai - avatar
0
whole code
31st Oct 2022, 2:01 AM
Madham Muni Siva Raghava
Madham Muni Siva Raghava - avatar