subject

The following code is intended to test whether the int variable num is less than 10, and if so print a warning and set it to 10. The code then prints the value of num. if (num < 10)
System. out. println( "This is smaller than 10" );
num = 10;
System. out. println("Value of num is " + num);
What correction should be made so the code functions as intended?

An else statement should be added between the 3rd and 4th lines
The final line should be printed every time, not just when num hasn’t been changed.
A semicolon should be added at the end of the first line
The operator β€˜<’ should be changed to β€˜<=’ in the if statement
No correction should be made
Curly braces β€˜{ }β€˜ should be added to enclose the second and third lines


The following code is intended to test whether the int variable num is less than 10, and if so prin

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 03:50
Iam a bacterium. i cause stomach cramps and diarrhea. i am caused by eating rotten foodssuch as chicken, fish, or eggs. sometimes turtles carry my bacteria.what am i?
Answers: 2
question
Computers and Technology, 23.06.2019 06:40
How many nibbles can be stored in a 16-bit word?
Answers: 1
question
Computers and Technology, 23.06.2019 16:00
Which analyst position analyzes information using mathematical models to business managers make decisions?
Answers: 1
question
Computers and Technology, 24.06.2019 03:30
Explain the importance of html in web page designing in 20 sentences..
Answers: 1
You know the right answer?
The following code is intended to test whether the int variable num is less than 10, and if so print...
Questions
question
Mathematics, 24.08.2019 10:50
question
English, 24.08.2019 10:50
question
Chemistry, 24.08.2019 10:50
Questions on the website: 13722361