Java help

profilehoc34

The code below is supposed to print "Hello World" however many times the user tells it to. Does it work correctly? If not, how would you fix it?

 
System.out.print("How many times should I print it? ");
int times = reader.nextInt();
 
for( int i=1; i<times; i++ ){
   System.out.println("Hello World!);
}
    • 11 years ago
    • 3
    Answer(3)

    Purchase the answer to view it

    blurred-text
    NOT RATED

    Purchase the answer to view it

    blurred-text
    NOT RATED
    • attachment
      java_problem.docx

    Purchase the answer to view it

    blurred-text
    NOT RATED
    Bids(0)