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
kirill [66]
3 years ago
13

Assume that a two-dimensional rectangular array of integers called matrix has been declared with six rows and eight columns. Wri

te a for loop to exchange the contents of the second column with the fifth column.

Computers and Technology
1 answer:
IgorLugansk [536]3 years ago
4 0

Answer:

following are the program in C++ which is given below

Explanation:

following are the program in C++

#include <bits/stdc++.h>

using namespace std;

int main()  

{

int matrix[6][8]={{1,2,3,4,5,6,7,8},{9,10,11,12,13,14,15,16},{3,3,3,3,3,3,3,3},{4,4,4,4,4,4,4,4},{5,5,5,5,5,5,5,5},{6,6,6,6,6,6,6,6}};

cout<<"Matrix befor swapping:"<<endl;

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

{

for(int j=0;j<8;j++)

{

cout<<matrix[i][j]<<" ";

}

cout<<endl;

}

for(int i=0;i<6;i++) //iterating over the loop

{

int temp=matrix[i][1];

matrix[i][1]=matrix[i][7];

matrix[i][7]=temp;

}

cout<<"Matrix After swapping:"<<endl;

for(int i=0;i<6;i++) //iterating over the loop

{

for(int j=0;j<8;j++)

{

cout<<matrix[i][j]<<" ";

}

cout<<endl;

Output

attachment are added for the above output.

following are the description of the program

1) read the matrix [i][j] by the user

2) in the loop we exchange the content of 2nd column with 5th column

You might be interested in
You can use the Ignore All button to ignore the current and all future occurrences of a flagged word. True or False
Pepsi [2]

Answer: True

Explanation: "Ignore All" button is the button that operates when the user wants to ignore the word that is flagged .Flagged words are those which chosen by user to be banned and don't want to use in future.

Ignore all button helps in the ignoring of the spelling check of the words that the user is sure about and the words that user don't want to be the part of their content.This banning is for the future use and current time as well.Thus, the statement is true.

4 0
3 years ago
(Count positive and negative numbers and compute the average of numbers) Write a program that reads an unspecified number of int
Papessa [141]

Answer:

Explanation:

Sorry it  is in Java, though you can covert it using converter

public class Exercise {

public static void main(String[] args) {

 Scanner input = new Scanner(System.in);

 int positives = 0;  // Count the number of positive numbers

 int negatives = 0;  // Count the number of negative numbers

 int count = 0;   // Count all numbers

 double total = 0;  // Accumulate a totol

 // Promopt the user to enter an integer or 0 to exit

 System.out.print("Enter an integer, the input ends if it is 0: ");

 int number = input.nextInt();

 if (number == 0) { // Test for sentinel value

  System.out.println("No numbers are entered except 0");

  System.exit(1);

 }

 while (number != 0) {// Test for sentinel value

  if (number > 0)

   positives++; // Increase positives

  else

   negatives++; // Increase negatives

  total += number; // Accumulate total

  count++;    // Increase the count

  number = input.nextInt();

 }

 // Calculate the average

 double average = total / count;

 // Display results

 System.out.println(

  "The number of positive is " + positives +

  "\nThe number of negatives is " + negatives +

  "\nThe total is total " + total +

  "\nThe average is " + average);

}

}

7 0
3 years ago
Write a program that reads in an array of type int . you may assume that there are fewer than 50 entries in the array. your prog
Alla [95]
This may be a difficult thing to do so for anyone to ACTUALLY answer this you migghttt want to up the amount of points you get for answering maybe, 20-40 points.
7 0
3 years ago
Carmen has met new people online that she enjoys talking to. One of these people has asked her to meet at the park in person and
slavikrds [6]

Answer:

Don't go to the park!!

Explanation:

You don't know the person personally and they could be acting and hurt you. Especially if they tell you not to tell someone. So don't go!

8 0
3 years ago
How can the connection to salesforce be restricted only to the employee portal server? Universal containers (UC) uses a legacy E
Ad libitum [116K]

Answer

To restrict the connection only to the employee portal server, the IP address of the application should be added into the list of Trusted IP's.

Explanation:

Trusted IP's are the IP's that are used to identify the users that can be verified easily. Those users whose IP's are not listed in the trusted IP list needs to verify their identity by sending them login code on each transaction.

<em>In above mentioned case, We need to enlist the IP address of employee portal list in trusted IP list to ensure the restriction of login to employee only.</em>

4 0
3 years ago
Other questions:
  • Who are the founders of video-sharing site Dailymotion?
    7·1 answer
  • What is the primary criticism against a national identification system based on biometric data?
    13·1 answer
  • Select the correct answer.
    6·1 answer
  • An airline company would like to easily locate lost luggage. What technology would make it easier for them to locate the luggage
    6·2 answers
  • Which scenario is invalid for execution by unit Tests? A. Executing test scenarios for negative test scenarios.B. Executing meth
    5·1 answer
  • Which of the following is the definition of registration authority ( RA)?
    10·1 answer
  • Darcy was working on a presentation on playing chess. Because she chose the Checkerboard animation for her slide title, she had
    15·2 answers
  • Write a program that computes how much each person in a group needs to pay (after tax and tip) when splitting the bill equally.
    5·1 answer
  • Transition words and phrase in a paragraph
    15·2 answers
  • Damion recently did an update to his computer and added a new video card. After the update, Damion decided that he would like to
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!