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 Chief Information Officer (CIO) has determined the company’s new PKI will not use OCSP. The purpose of OCSP still needs to
Step2247 [10]

Answer:

B. Implement a key escrow.

Explanation:

A key escrow can be defined as a data security method of storing very essential cryptographic keys.

Simply stated, key escrow involves a user entrusting his or her cryptographic key to a third party for storage.

As a standard, each cryptographic key stored or kept in an escrow system are directly linked to the respective users and are encrypted in order to prevent breach, theft or unauthorized access.

Hence, the cryptographic keys kept in an escrow system are protected and would not be released to anyone other than the original user (owner).

In this scenario, the Chief Information Officer (CIO) has determined the company's new public key infrastructure (PKI) will not use online certificate status protocol (OCSP). However, the purpose of online certificate status protocol (OCSP) still needs to be addressed. Thus, what should be implemented is a key escrow because the online certificate status protocol (OCSP) is an internet protocol used for maintaining the security of a server and obtaining a digital certificate that has been revoked.

8 0
3 years ago
A nonprofit organization uses a contact management database to track donations, amounts donated, and all correspondence and phon
notka56 [123]

Answer:

nvbvbnvvbnbnvbnvbn

Explanation:

vbnvbnvbnbnnnbvnn

7 0
3 years ago
What is computer virus​
IRINA_888 [86]

Answer:

A type of malicious code or program written to alter the way a computer operates and is designed to spread from one computer to another.

Once a virus has successfully attached to a program, file, or document, the virus will lie dormant until circumstances cause the computer or device to execute its code. In order for a virus to infect your computer, you have to run the infected program, which in turn causes the virus code to be executed.

8 0
3 years ago
Read 2 more answers
6. What is saddle-stitch binding?
kifflom [539]
Commonly known as book stapling, ‘saddle stitched’ is one of the most popular binding methods. The technique uses printed sheets which are folded and nestled inside each other. These pages are then stapled together through the fold line. Saddle stitched binding can be applied to all book dimensions and both portrait and landscape orientation.
5 0
3 years ago
Read 2 more answers
Write a short program that allows the user to input a positive integer and then
pogonyaev

Answer:

// code in C++.

#include <bits/stdc++.h>

using namespace std;

// main function

int main()

{

   // variables

   int n;

   cout<<"Enter a positive number:";

   // read number

   cin>>n;

   // check number is positive or not

   while(n<0)

   {

   // if number is negative

       cout<<"Wrong input!!"<<endl;

       // ask again to enter again

       cout<<"Enter again:";

       // read number again

       cin>>n;

   }

   // generate random number between 1 to n

   int ran=rand()%n +1;

   // print random number

   cout<<"Random number between 1 to "<<n<<" is: "<<ran<<endl;

return 0;

}

Explanation:

Read a number from user.Then if input number is negative then ask user to enter a positive number again.After this generate a random number between 1 to n.Print that random number.

Output:

Enter a positive number:-12

Wrong input!!

Enter again:9

Random number between 1 to 9 is: 2

5 0
3 years ago
Other questions:
  • Which partitioning method must you use for a 4-tb hard drive?
    13·1 answer
  • According to the order of operation in Excel: a. Excel performs exponentiation, then multiplication, then division, then subtrac
    10·1 answer
  • What happens if you never confirm your facebook account?
    8·1 answer
  • Which kind of image is indispensable and needs added text to go with it? A. a map B. a chart C. a graph D. a photograph
    9·2 answers
  • Write the definition of a function named rotate4ints that is passed four int variables. The function returns nothing but rotates
    9·1 answer
  • Tipos de estructuras A. Expresiones y de variables B. Selectivas y de control C. Instrucciones y parámetros
    5·1 answer
  • Type the correct answer in each box. Spell all words correctly.
    12·1 answer
  • Emma wants an artificial intelligence system with limited information on botony to identify a type of plant from an image. which
    6·1 answer
  • How does a computer do its work? Mention its working principle.<br><br>​
    8·1 answer
  • What are the five generations of computer software​
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!