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
Can anybody do Algorithm 2 for me (with Python).<br> Answer = 25 points.
Nostrana [21]

Answer:

age=int(input("Enter age"))

if age>=18:

    print("You are Young")

else

   print("You are child")

Explanation:

if you have any query or any problem kindly ask in comment

5 0
3 years ago
Which of the selections below is not a benefit of imaging the computers on your network? There are fewer licensing fees because
Stella [2.4K]
Among the selections, the statement that is not a benefit of imaging the computers on your network is: It helps to lessen the impact of spyware on the network. 
The area that studies covering digital images - images that can be stored on a computer like bit-mapped images is called Computer imaging or digital imaging. 
8 0
3 years ago
A compression scheme for long strings of bits called run-length encoding is described as follows: Rather than record each 0 and
Musya8 [376]

Answer: (B) Lossless compression

Explanation:

 According to the question, the given technique is the example of the lossless compression. The lossless compression is one of the technique that decompress the data into the original data form without any type of losses.

The lossless compression is the technique that usually compress the data, text and the databases. This technique also improve the compression rate helps in reconstruct the original data. It is used in various types of encoding methods, GNU tool and zip file.

3 0
4 years ago
Discuss data and its types from computer programming and data analysis prospectively?​
Hoochie [10]

Answer:

With the use of data and their types the extent of how much data can be stored can get insanely large. types like doubles and longs allow for a range of values nearly incomprehensible in their size for storing user information, web pages, games ect. Using them essentially allows you to plan for the future of the size of whatever you're creating. On top of that, it allows for a preciseness not typically able to be reached without these types.

3 0
3 years ago
This project is to mimic a meeting request system by checking the requesting party’s validity, and the number of people attendin
alexgriva [62]

Answer:

See explaination for the program code

Explanation:

Meeting.java

------

import java.util.Scanner;

public class Meeting {

public static void main(String[] args) {

Scanner input = new Scanner(System.in);

final int ROOM_CAPACITY = 100;

int numPeople, diff;

String name;

System.out.println("****** Meeting Organizer ******");

System.out.print("Enter your name: ");

name = input.nextLine();

System.out.println("Welcome " + name);

do{

System.out.print("\nHow many people would attend the meeting? (type 0 to quit): ");

numPeople = input.nextInt();

if(numPeople < 0)

System.out.println("Invalid input!");

else if(numPeople != 0)

{

if(numPeople > ROOM_CAPACITY)

{

diff = numPeople - ROOM_CAPACITY;

System.out.println("Sorry! The room can only accommodate " + ROOM_CAPACITY +" people. ");

System.out.println(diff + " people have to drop off");

}

else if(numPeople < ROOM_CAPACITY)

{

diff = ROOM_CAPACITY - numPeople;

System.out.println("The meeting can take place. You may still invite " + diff + " people");

}

else

{

System.out.println("The meeting can take place. The room is full");

}

}

}while(numPeople != 0);

System.out.println("Goodbye!"); }

}

output

---

****** Meeting Organizer ******

Enter your name: John

Welcome John

How many people would attend the meeting? (type 0 to quit): 40

The meeting can take place. You may still invite 60 people

How many people would attend the meeting? (type 0 to quit): 120

Sorry! The room can only accommodate 100 people.

20 people have to drop off

How many people would attend the meeting? (type 0 to quit): 100

The meeting can take place. The room is full

How many people would attend the meeting? (type 0 to quit): 0

Goodbye!

4 0
4 years ago
Other questions:
  • Pls help me. ask yourself what would jesus do...
    14·1 answer
  • When a typist changes from a conventional typewriter to a word processor, his typing schema will have to _____ to incorporate th
    12·1 answer
  • Data bars describe a graphic element that
    9·2 answers
  • Can anyone help me with getting bash ubuntu on windows setup?
    15·1 answer
  • &gt;&gt;&gt; from hog import *
    15·1 answer
  • Attributes of a website indicates a more reliable source of information
    14·1 answer
  • What is the range of addresses for conditional branches in MIPS (K = 1024)?
    6·1 answer
  • Que quiere decir analogico
    6·1 answer
  • How do I fix this? It stopped adding up my points when i did one of the challenges.
    11·2 answers
  • How to run angular project from github.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!