1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Mademuasel [1]
3 years ago
6

What is output by the following program? int i = 7; while (i>=2){System.out.print (i +""); if ((i%3) == 0){ i +2; } else { i/

=2;}}
Computers and Technology
1 answer:
stiks02 [169]3 years ago
6 0

Answer:

The correct answer to this question is: "this program give an error".

int i = 7; //declare a variable(i) and assign value.

while (i>=2) //use loop and check condition.i greater then equal to 2.

{

System.out.print (i +""); //print value of i.

if ((i%3) == 0) //hold remainder

{

i +2; //error.

}

else

{

i/=2; //hold Quotient

}

}

Explanation:

In the above program, there is an error in the if block because it is not the correct way to declare. To use the variable from the correct output we use a variable like this.

Example

int i = 7;

//declare a variable(i) and assign value.

while (i>=2)

//use loop and check condition.i greater then equal to 2.

{

System.out.print (i +""); //print value of i.

if ((i%3) == 0) //hold remainder

{

i =i+2;

}

else

{

i/=2; //hold Quotient

}

}

Output: 732

You might be interested in
What was the first carbonated drink to be introduced in the US?
adelina 88 [10]
Taco bell...........................................................................................................................................................................

6 0
3 years ago
1) Which of the following would you NOT see on a Windows 10 Start menu?
Sati [7]
Task view

I hope this helps you :)
3 0
2 years ago
A sandbox is known as a holding area for website or .
Bingel [31]

Answer:

blog

Explanation:

7 0
2 years ago
Read 2 more answers
Betty was sitting at a coffee shop reading her favorite book. She heard an explosion nearby. In a few, she could hear ambulance
enot [183]
B or D are the options I would suggest.
4 0
2 years ago
Read 2 more answers
Compare the two types of formatting that IDE devices must go through. What is the primary difference between the two?
Andrei [34K]
A quick format<span> changes the file system while the </span>full format<span> also checks the </span>drive for bad sectors.  <span>The scan for bad sectors is the reason why the Full </span>format<span> takes twice as long as the </span>Quick format<span>. If you choose the </span>Quick format<span> option, the </span>format<span> removes address files from the partition, but does not scan the disk for bad sectors.</span>
7 0
3 years ago
Read 2 more answers
Other questions:
  • Use the variables k and total to write a while loop that computes the sum of the squares of the first 50 counting numbers, and a
    10·1 answer
  • Which of the following code correctly registers a handler with a button btOK?a. btOK.setOnAction(e -&gt; System.out.println("Han
    6·1 answer
  • Can Word Processing (WP) programs be used for DTP? Explain your answer
    7·1 answer
  • EDVAC stands for? on which theory it is made on?
    15·1 answer
  • Define additional characteristics such as font weight or style for an html tag
    5·1 answer
  • Help me or I'll go insane I've 6x already I'm about to lose it!!!!
    11·2 answers
  • What output is generated by this for loop?
    6·1 answer
  • Why is a computer called"a computer"?​
    12·2 answers
  • I ate five M&amp;Ms: red, green, green, red and yellow. Only these three colors are possible. I assume that p(yellow)=3p(green)
    9·1 answer
  • Which of the following is NOT a long-term storage device?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!