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
nalin [4]
3 years ago
15

Suppose that a is declared as an int a[99]. Give the contents of the array after the following two statements are executed: for

(i = 0; i <99 ; i++) a[i] = a[a[i]];
Computers and Technology
1 answer:
mr_godi [17]3 years ago
5 0

Answer:

Each array position holds the position from which the information is going to be retrieved. After the code is run, each position will have the information retrieved from that position.

Explanation:

The best way to solve this problem is working as if we had a very small array. Then we can generalize for the large array.

For example

int a[3];

a[0] = 1; a[1] = 2; a[2] = 0;

for(i = 0; i < 3; i++)

a[i] = a[a[i]];

When i = 0, we have:

a[i] = a[a[i]] = a[a[0]] = a[1] = 2;

When i = 1, we have

a[i] = a[a[i]] = a[a[1]] = a[2] = 0;

When i = 2, we have

a[i] = a[a[i]] = a[a[2]] = a[0] = 1;

Basically, in our small example, each array position holds the index from which we are going to retrieve the information. The same is going to happen in the array of length 99. After the code is run, each position will have the information retrieved from that position

You might be interested in
We write programs as a sequence of operation. they flow through the computer as?
lys-0071 [83]
I belive the correct answer would be binary code because computers see the coding as 00100001 
5 0
4 years ago
The set of specific, sequential steps that describe exactly what a computer program must do to complete the work is called a(n)
nataly862011 [7]

Answer:

D). Algorithm

Explanation:

The set of specific, sequential steps that describe exactly what a computer program must do to complete the work is called an algorithm.

From the question, it is clear the correct option is algorithm.

In simple terms, to solve a problem the set of rules to follow is called algorithm. Algorithm in computer programming describes the steps that explains not only the task that needs to be performed, but also how to do it.

In algorithm, the steps are needed to be in the right sequence.

6 0
3 years ago
Read 2 more answers
To open the find and replace dialog box with shortcut keys, hold down ctrl and press ________
ratelena [41]
Hi. To open the find and replace dialog box with shortcut keys, hold down CTRL and press the letter "H". 

Hope this helps.
Take care.
8 0
4 years ago
How do companies use LinkedIn ?
Semenov [28]

Answer:

  1. Introducing new products or services you’ve developed.
  2. Differentiating yourself from your competitors.
  3. Finding job candidates who can make a significant contribution to your business success.
  4. Checking on what your competition is doing.
  5. Improving your ranking in search engines.
8 0
3 years ago
Read 2 more answers
g Given a 5 by 5 matrix of all positive values, write a program to find and display the greatest product of the 2 adjacent value
Rom4ik [11]

Answer:

Check the explanation

Explanation:

% iterate through each column (outer loop) , then iterate rows-1 (inner loop)

%take product of adjacent rows

mat = input('enter 5 by 5 matrix : ');

[R,C] = size(mat);

max_prod =0;

for c =[1:C]

for r=[1:(R-1)]

temp = mat(r,c)*mat((r+1),c);

if max_prod<temp

max_prod=temp;

end

end

end

fprintf('Greatest product : %i\n', max_prod)

Kindly check the output in the attached image below.

7 0
3 years ago
Other questions:
  • Acme Parts runs a small factory and employs workers who are paid one of three hourly rates depending on their shift: first shift
    5·1 answer
  • Explain why the 7 bit standard ASCII code needs to have the highest bit set to a zero
    11·1 answer
  • Pls help........
    15·1 answer
  • How do myths impact today’s society.(A
    14·2 answers
  • (01.05 LC)
    7·2 answers
  • What Is entered into the system as input?
    13·1 answer
  • Which of these conclusions supports the fact that Eclipse is categorized as an IDE?
    8·1 answer
  • LaToya is creating a program that will teach young children to type. What keyword should be used to create a loop that will prin
    9·1 answer
  • A heart murmur is caused by incorrect operation of ________?​
    7·1 answer
  • Pls help me computer science discoveries
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!