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
larisa [96]
3 years ago
14

Create a 4x5 matrix with ones everywhere and zeros on the last row.

Computers and Technology
1 answer:
Stells [14]3 years ago
7 0

Answer:

#include <iostream>

using namespace std;

int main() {

   int a[4][5];//declaring a matrix of 4 rows and 5 columns.

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

   {

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

       {

           if(i==3)//initializing last row as 0.

           {

               a[i][j]=0;

           }

           else//initializing last row as 1.

           {

               a[i][j]=1;

           }

       }

   }

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

   {

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

       cout<<a[i][j]<<" ";//printing the matrix.

       cout<<endl;

   }

return 0;

}

Output:-

1 1 1 1 1  

1 1 1 1 1  

1 1 1 1 1  

0 0 0 0 0

Explanation:

I have created a matrix of size 4 rows and 5 columns.I have used for loops to fill the array.To fill the last row with 0 i have used if statement.else we are filling it with 1.

You might be interested in
QUICK PLZZZZZZZ Which one of the following is considered a peripheral? A Software B Mouse C USB connector D Motherboard
il63 [147K]

A MOUSE is considered a peripheral. A peripheral device connects to a computer system to add functionality.

6 0
3 years ago
What are the different ways to represent compounds? Check all that apply. a structural formula a ball model a space-filling mode
bagirrra123 [75]

Answer:

Compound can be represented as a molecular formula,empirical formula, structural formula,ball and stick model, space filling model.

Explanation:

Compounds can be represented as a chemical formula and a molecular model.

A chemical formula shows the number of atoms present in a compound. Whereas, the molecular model shows the geometry of a compound.

The chemical formula can be further divided into 3 types:

1)molecular formula: indicates the actual number of atoms in a compound.

2)empirical formula: indicates the relative number of atoms present in a compound.

3)structural formula: is illustrated in the forms of lines which actually shows the bond(such as covalent bond) and also shows how atoms are connected to each other in a molecule.

Molecular model is preferably a better way to represent a molecule. It is categorised into the following:

1)a ball and stick model: its a three dimensional representation of a compound. The atom(s) in a compound is represented by ball while, their chemical bonds are shown by sticks.

2)A space filling model: its a three dimensional structure,it represents the size and shape of the whole molecule,showing relatively how much space each atom in a molecule occupies.

7 0
3 years ago
Read 2 more answers
Why is storage a pertinent component of any computer system?
gladu [14]

Answer:

Storage is important because it needs to have a place to store data

Explanation:

8 0
3 years ago
A network administrator is designing a new network infrastructure that includes both wired and wireless connectivity. Under whic
Ganezh [65]

Wireless connectivity is recommended for use with laptops or mobile devices, especially as newer devices are less likely to have ethernet connectivity built in. In either case, use of wireless technology make it easier for users to move around without having to worry about being plugged in. Wired connections are still recommended for anything that doesn't need to be able to move as it is generally more reliable, and depending on the devices involved, could offer a faster connection.

7 0
3 years ago
An html document thats generated by a web application is a ____ web page.
scoundrel [369]
It is an html web page hope it helps

5 0
3 years ago
Other questions:
  • Which of the following is the correct style tag for having the web page's text be aligned to the right?
    6·2 answers
  • Given the following code fragment, how many times does the loop body execute? int laps = 50; int myNum = 1; do { myNum = myNum +
    9·1 answer
  • Because the data was formatted the same in two inventory files, you decided to combine their contents into one file. Now you wan
    7·1 answer
  • If Digital Assistants are free to use why companies do spend millions of dollars to develop and support them?
    8·1 answer
  • According to a case study in one of our weekly chapter reading, nearly..................... percent of all employees send work e
    11·2 answers
  • LensForAll is a company that sells affordable contact lenses on its website. The CEO of the company realizes that an app must be
    9·1 answer
  • Hioo ^U^
    8·1 answer
  • If not cleared out, log files can eventually consume a large amount of data, sometimes filling a drive to its capacity. If the l
    10·2 answers
  • How do i know my child's login info for parent infinite campus
    14·1 answer
  • OSI layer for HDLC??​
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!