The code that will swap the first two elements of an array called friends is:

a) friends[0] = friends[1];
friends[1] = friends[0];
b) temp = friends[1];
friends[2] = friends[1];
friends[1] = temp;
c) temp = friends[0];
friends[1] = friends[0];
friends[0] = temp;
d) temp = friends[0];
friends[0] = friends[1];
friends[1] = temp;

d) temp = friends[0];
friends[0] = friends[1];
friends[1] = temp;

Computer Science & Information Technology

You might also like to view...

Command buttons are created using aninputelement with thetypeattribute set torange.?

Answer the following statement true (T) or false (F)

Computer Science & Information Technology

List the steps involved in payback analysis.

What will be an ideal response?

Computer Science & Information Technology