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
gayaneshka [121]
4 years ago
9

Create a C++ program that declares, initializes, and outputs the values contained in a two-dimensional array

Computers and Technology
1 answer:
Kazeer [188]4 years ago
8 0

Answer:

// here is code in C++.

#include <bits/stdc++.h>

using namespace std;

// main function

int main()

{

// variables

int r_size,c_size;

cout<<"enter the number of row:";

// read the value of row

cin>>r_size;

cout<<"enter the number of column:";

// read the value of column

cin>>c_size;

// create a 2-d array

int arr[r_size][c_size];

// read the value of array

cout<<"enter the elements of array:"<<endl;

for(int x=0;x<r_size;x++)

{

for(int y=0;y<c_size;y++)

{

cin>>arr[x][y];

}

}

cout<<"elements of the array are:"<<endl;

// print the array

for(int a=0;a<r_size;a++)

{

for(int b=0;b<c_size;b++)

{

cout<<arr[a][b]<<" ";

}

cout<<endl;

}

return 0;

}

Explanation:

Here we have demonstrate a 2- dimensional array. In which, how to read the elements and how to print elements of array.Read the value of row and column from user.Create a 2-d array of size r_sizexc_size. then read the elements of array either row wise or column wise. Then print the elements.To print the elements, we can go either row wise or column.

Output:

enter the number of row:2

enter the number of column:3

enter the elements of array:

1 2 3

2 3 4

elements of the array are:

1 2 3

2 3 4

You might be interested in
. Identify an emerging crime issue in your community using data available from sources such as local newspapers, online police r
Minchanka [31]

A crime problem in my community is related to cell phone theft. According to the local newspaper, it is estimated that in my city about 10 cell phones are stolen per week. Still according to the local newspaper, most of these robberies occur in the city center and in the periphery, with women being the biggest victims.

Although the police have shown themselves to be a restraining force on this type of crime, few arrests have been made successfully, mainly for the negligence of the victims in providing a complaints.

The main driving force behind this crime is drug trafficking. Most burglars steal cell phones to sell them and have money to buy drugs. This is totally related to the government's neglect to promote quality education in the city, allowing several children and young people to stay on the street and run the risk of becoming involved in the traffic.

A cause and effect diagram for this situation is:

Irresponsible government ---> poor quality education ---> children and adolescents on the streets ---> involvement in drug trafficking ---> theft of cell phones ----> frightened population --->  lack of complaints ----> criminals on the street.

3 0
3 years ago
Analyze the error in the html code :<br><br> HTML
Andrei [34K]

Answer:

The World Wide Web Consortium provide a simple online tool (https://validator.w3.org/) that automatically check your HTML code and point out any problems/errors your code might have, such as missing closing tags or missing quotes around attributes.

Explanation:

your question is not clear

hope it helps

6 0
3 years ago
Ways to ask for help effectively include
Step2247 [10]

Answer:

All of these choices

Explanation:

Clarity → the quality of being coherent and intelligible.

Sincerity → the quality of being free from pretense, deceit, or hypocrisy

Open mind → Open-mindedness is receptiveness to new ideas.

8 0
3 years ago
Computer a sends a packet intended to reach computer f. along its path it arrives at computer
disa [49]
<span>To the computer f, this answer is because when reading the statement I assume that there is no type of connection and / or communication between the computer a and c; therefore to be profitable the computer c should return the package sending it back to computer f.</span>
5 0
3 years ago
Robert is leading a project online that includes students from different cultures. Two of the students spend most of the time li
enyata [817]

Answer:

A & C

Explanation:

8 0
3 years ago
Other questions:
  • ________ sets up a point-to-point connection between two computer systems over an Internet Protocol (IP) network. A. Point-to-Po
    15·1 answer
  • Which kind of software allows users to draw pictures, shapes, and other graphical images with various on-screen tools such as a
    14·1 answer
  • In what year was the 1st zelda game released
    5·2 answers
  • Who can provide you with a new password when you have forgotten your old one?
    14·2 answers
  • Good ways to increase sales on phone accesories?
    10·2 answers
  • If a student passes off an author’s work as his or her own, the student has
    6·1 answer
  • Fill in the blank with the correct term.
    10·2 answers
  • A rectangle indicates a single process.true or false​
    7·2 answers
  • Hmm what should i do with this information
    14·2 answers
  • Your friends are having difficulties with their computer setups. Can you suggest a way to help each friend?
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!