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]
4 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]4 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
Write a program that keeps taking integers until the user enters in python
soldi70 [24.7K]

int main {

//variables

unsigned long num = 0;

std::string phrase = " Please enter your name for confirmation: " ;

std::string name;

//codes

std::cout << phrase;

std::cin>> name;

while ( serial.available() == 0 ) {

num++;

};

if ( serial.avaliable() > 0 ) {

std::cout << " Thank you for your confirmation ";

};

};

3 0
3 years ago
Which of the following describe the characteristics of a good logo? Choose all that apply. It is a complex design It is memorabl
nasty-shy [4]

Answer:

It is memorable.

It utilizes the elements of design.

Explanation:

IMO these 2 will determine a good logo. Since everyone should remember it if they come across it again in the future

6 0
2 years ago
When a file is double clicked what happens
Naddik [55]
I am pretty sure the file opens 
6 0
3 years ago
Your organization has hired a penetration tester to validate the security of your environment. The penetration tester needs to d
yulyashka [42]

Answer:

Port scanner

Explanation:

The penetration tester would most likely use a port scanner. A port scanner can be explained to be an application that is made to check a server or host for ports that are open. This application can also be used by administrators to check their security networks so as to know those network services that are running on a host and also to know existing vulnerabilities. Attackers also use this to exploit victims.

5 0
3 years ago
Pretrial services programs are also known as early intervention programs. <br> a. True <br> b. False
tensa zangetsu [6.8K]
A) True 


Good luck! (:
7 0
3 years ago
Other questions:
  • Operating systems that have windows and icons have which type of user interface?
    15·1 answer
  • Why would you activate more than one nic on a pc?
    7·1 answer
  • When you select a state abbreviation from a combo box, how does the form control record your selection?
    8·1 answer
  • Keion works as a freelancer creating websites and designing logos for clients. He recently had a hard drive failure and lost wor
    12·1 answer
  • a mobile base in an urban environment has the power of 15 microW at 175 m. If the propagation follows an inverse cube power law,
    11·1 answer
  • A number of related records that are treated as a unit is called
    6·1 answer
  • The following processes are being scheduled using a preemptive, round-robin scheduling algorithm. Each process is assigned a num
    6·1 answer
  • Computer programs and games are called what?
    13·1 answer
  • Chapter
    15·1 answer
  • Fill in the blank: In a Word chart, text that describes the data represented in a chart and that is typically displayed on the r
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!