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
son4ous [18]
4 years ago
9

Given the following code fragment, how many times does the loop body execute? int laps = 50; int myNum = 1; do { myNum = myNum +

2; laps = laps + 1; } while(laps <= 1);
Computers and Technology
1 answer:
Jlenok [28]4 years ago
8 0

Answer:

one

Explanation:

The loop is used to execute the part of code or statement again and again until the condition is not FALSE.

There are three types of loop in programming.

1. for loop

2.while loop

3. do-while loop

Do-while has one special property which makes it different from other loops.

The loop statement executes once if the condition of the loop is failed in the starting.

In do-while, the statement executes first and then while checking the condition.

let discuss the code:

initially, laps=50, myNum=1

then, the program executes the statement in the loop.

so, myNum = 1 + 2=3.

A value 3 is assign to the variable myNum.

laps = 50 + 1=51.

A value 3 is assigned to the laps variable.

then while checking the condition (51 <= 1) which is FALSE.

The program terminates the loop.

Therefore, the answer is one.

You might be interested in
Which of the following have the smallest file size
Alla [95]

Answer:

A.

Explanation:

Ebooks are typically only text, which is smal.

However, a Photo can be very small too, so the answer is not definitive.

3 0
3 years ago
Which of the instances below is an example of a Trojan horse? Question 2 options: a) An attachment in an email that is really a
sergij07 [2.7K]

Game-theif Trojans is the malware that makes a backdoor into your email account by which you are playing a game or has downloaded it and thus by this all information of user is exposed.

So option D is the answer.

Option A cannot be answer because Trojan does not use files for its purpose.

Option B cannot be a good option because Trojan works in online could.

Option C cannot be a option because Trojan does not need executable to attack your account.

3 0
3 years ago
Read 2 more answers
what is the most state-of-the-art computer network Hardware in terms of power, integration, and merging?
Vika [28.1K]
Apple is the most state of the art computer
5 0
3 years ago
Create a public class called Catcher that defines a single class method named catcher. catcher takes, as a single parameter, a F
Cerrena [4.2K]

Answer:

Sorry mate I tried but I got it wrong

Explanation:

Sorry again

6 0
3 years ago
FILL IN THE BLANK
Gwar [14]

Answer:

search

Explanation:

4 0
3 years ago
Other questions:
  • What is a drawback to being in Slide Show mode? a- Being able to review each slide in order
    8·2 answers
  • Name the written test a potential driver must pass and list the minimum required score to earn a learners license?
    9·1 answer
  • Michelle is a salesperson who is paid on commission. She just sold a customer a very reasonably priced tablet, but only after th
    14·1 answer
  • The hotspot created by MiFi is password protected and can be used to connect Wi-Fi devices located within ____ feet of the MiFi
    9·1 answer
  • What does the regular expression [a-z0-9\-] mean?
    8·1 answer
  • PLEASE HELPP!!!!!
    14·1 answer
  • Complete the code to finish this program to analyze the inventory for a store that sells purses and backpacks.
    7·1 answer
  • Diferencias entre ciencia y tecnologia
    5·1 answer
  • What version of bluetooth is installed on the yaesu ft-5dr?.
    8·1 answer
  • An Inspect and Adapt (I&amp;A) event is occurring and a program is trying to address a long-existing problem (WIP)?"unreliable P
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!