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
borishaifa [10]
4 years ago
7

Write a "while" loop equivalentto the following "for" loop: (2Points)

Computers and Technology
1 answer:
kap26 [50]4 years ago
6 0

Answer:

int i,t = 0;

   i=0;  //initialize

   while(i<22){

       t = t + i;

           cout << t;

           i += 3;   //increment

   }

   cout << endl;

Explanation:

Loops are used to execute the part of the code again and again until the condition is not true.

In the programming, there are three loop

1. for loop

2. while loop

3. do-while loop

The syntax of for loop:

for(initialize; condition; increment/decrement){

   statement;

}

The syntax of while loop:

initialize;

while(condition){

   increment/decrement;

}

In the while, we change the location of initializing which comes before the start of while loop, then condition and inside the loop increment/decrement.  

You might be interested in
Select the true statement about HTML. HTML is a language that is used to create Web pages. HTML tags tell a web browser when to
Alexxx [7]

Answer: HTML is a language that is used to create Web pages.

Explanation:

HTML (Hypertext Markup Language) simply refers to the code which is used for the structuring of a web page and its content. e.g the content can be structured by using images, in data tables or within a set of paragraphs.

Therefore, the correct statement about HTML is that HTML is a language that is used to create Web pages.

6 0
3 years ago
Read 2 more answers
A minor with prior convictions of Minor in Possession (MIP) who is charged with a subsequent MIP may be penalized with a jail se
GarryVolchara [31]
The minor may be penalized with a jail sentence of up to thirty days for his second offence.  A jail sentence of up to sixty days is possible for third offence. Under MCL 436, a minor is someone who is under twenty one years old. Such minors may not purchase, consume or be in possession of any alcoholic liquor. Possession of alcoholic drinks can be actual or constructive. It is actual when you have direct physical control over it and it is constructive when you know where it is and you have reasonable access to it.
3 0
3 years ago
Read 2 more answers
Can anyone help me out with my photography questions?
Oliga [24]
Verifying, The answer above me is correct
6 0
2 years ago
Two circuits are created using two identical light bulbs. In the circuit A, the bulbs are hooked up in series. In circuit B, the
Ulleksa [173]
C is not correct since in the case of circuits that are lined up in series, if one or them dies they all die.
5 0
3 years ago
Read 2 more answers
In the Unified Process (UP), related activities are grouped into UP ____. a. Services b. Disciplines c. Cycles d. Practices
Paha777 [63]

Answer:

b. Disciplines

Explanation:

The Unified Process (UP) is a type of development framework that repeats itself and can be customized and used for several different variations of the same underlying process. In the Unified Process (UP), related activities are grouped into UP Disciplines, as one of the many components that make up the Unified Process.

6 0
3 years ago
Other questions:
  • Consider the following JavaScript program:
    8·1 answer
  • You want to discard your old computer and want to securely erase the data from your hard drive. What can you use to do this and
    10·1 answer
  • How could a system be designed to allow a choice of operating systems from which to boot? What would the bootstrap program need
    14·1 answer
  • How do I cite a website?
    7·2 answers
  • This software system shall consist of four source files (.cpp) and four header files (.h) defining four classes. The first class
    6·1 answer
  • Which type of graph or chart measures
    15·2 answers
  • You can easily view the ruler on a document by selecting the Show Ruler button located _____.
    11·2 answers
  • Peer collaboration helps develop critical-thinking skills, which is the ability to
    9·2 answers
  • How do you change the colors of files?
    11·1 answer
  • Jolly 4 pls link in description
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!