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
andreyandreev [35.5K]
3 years ago
6

Explain how for loops can be used to work effectively with elements in an array?

Computers and Technology
1 answer:
tresset_1 [31]3 years ago
7 0

Explanation:

There are three types of loops in programming languages which are as following:-

  1. for.
  2. while.
  3. do while.

The syntax for all the three loops is different.You will see mostly for loop used with the arrays because they are easy to implement.

the syntax of for loop is :-

for(int i=initial value;condition;i++)

{

body

}

In for loops you only have to write the conditions in only line else is the body of the loop.

for example:-

for array of size 50 printing the each element

for(int i=0;i<50;i++)

{

   cout<<arr[i]<<" ";

}

You have to initialize i with 0 and the condition should be i<size of the array and then increase the counter.

You might be interested in
The agency responsible for maintaining a database of all operational continuity facilities is:
just olya [345]
GSA or General Service Administration is the agency responsible for the maintaining a database of all operational continuity facilities. This agency also manages the procurement process for the Federal agencies. This independent agency was established in the United States in 1949.
6 0
3 years ago
Most editing commands in Word, such as cut, copy, and paste, can be found on which tab?
Anettt [7]
All these commands can be found on the home tab. Keyboard shortcuts (Ctrl-X, Ctrl-C, Ctrl-V) are also editing shortcuts.

:)
7 0
3 years ago
Read 2 more answers
If a laptop is getting no power while plugged in, which hardware part often needs to be replaced?
Eva8 [605]

Answer:

power supply is most likely faulty

3 0
3 years ago
A cell's address, its position in the workbook, is referred to as a ________________ when it is used in a formula.
Inga [223]

Answer:

A cell's address, its position in the workbook, is referred to as a <u>cell reference</u>  when it is used in a formula.

5 0
3 years ago
Does this mean that the radius is the input aka 3 ? what about the PI ?
strojnjashka [21]

Explanation:

In  this question

d is known as diameter

r is known as radius

c is known as circumference

pi is known as π

a is known as area

Now, In Maths

Area of circle = π×r×r

Circumference of circle = 2×π×r

Radius (r) = diameter(d)÷2

Given diameter is 6

then, r = 6 ÷2

r = 3

so, diameter = 6

radius = 3

circumference = 2×π×r

                        = 2×3.14×3 ( the value of π is equal to 3.14)

                        = 18.84

Area = π×r×r

= 3.14×3×3 ( the value of π is equal to 3.14)

 = 28.26

6 0
3 years ago
Other questions:
  • (Financial application: compound value) Suppose you save $100 each month into savings account with an annual interest rate of 5%
    6·1 answer
  • A binary search can be performed only on ____.
    6·1 answer
  • WHAT DOES THE WORD MONOCHROME MEAN?
    11·1 answer
  • Which level of education do most peoplebecoming a broadcast analyst obtain?
    13·2 answers
  • True or False <br><br> Rootkits are only made by black-hat hackers.
    11·1 answer
  • 1. Consider a direct-mapped cache that can accommodate 8Mbytes from a main memory, that uses a 32-bit address and 32-byte blocks
    5·1 answer
  • List the seven basic internal components found in a computer tower
    6·2 answers
  • How to prepare and draw a corresponding flowchart to compute the sum and product of all prime numbers between 1 and 50
    7·1 answer
  • Which of the following statements is TRUE of a peer-to-peer network?
    10·1 answer
  • When working in outline mode, press __________ and click the eye icon to change only one layer back to preview mode.
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!