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
When using bits to represent fractions of a number, can you create all possible fractions? Why or why not?
kumpel [21]

Answer:

The essence including its issue is listed in the interpretation subsection below.

Explanation:

  • Representing means the practice of someone using abstract, tangible as well as pictorial symbols as well as phrases and related circumstances to discuss ideas and express comprehension.
  • Representing fractions could indeed be overcome in almost the same manner as the positive factors of twice represented integers are using the negative factors of two to summarize to essentially fractional amounts.
4 0
3 years ago
What does a network backbone do? allows data to be delivered more quickly and efficiently makes data transfer from the cloud mor
Musya8 [376]

Answer:

A network backbone connects multiple networks together, allowing them to communicate with each other.

5 0
3 years ago
Read 2 more answers
Define an interface GUIComponent consisting of four method declaration: open: void-returning, accepts no parameters close: both
Lesechka [4]

Answer:

interface GUIComponent{

  public void open();

  public boolean close();

  public void resize(int width, int height);

  public void move(int x, int y);

}

Explanation:

3 0
2 years ago
2. Feet to Inches One foot equals 12 inches. Design a function named feetToInches that accepts a number of feet as an argument,
MariettaO [177]

Answer:

See the below the answer written in Matlab

Explanation:

function inches=feetToInches(feet)

prompt='enter the value of feet in digits';

feet=input(prompt)% ask for the value in feet that needs to be converted to inches

inches =feet*12; % converts feet to inches

x=['the value in inches is:  ',num2str(inches)];

disp(x) %display the result of the convertion

end

8 0
3 years ago
The do-while loop is a __________ loop that is ideal in situations where you always want
belka [17]
your answers are all D
4 0
3 years ago
Other questions:
  • Only Lysita knows the password for the question......
    10·1 answer
  • \What will the weather most likely be like the day after a warm front? (4 points) The temperature will be cool or cold, and ther
    7·2 answers
  • How to charge your phone quickly
    9·2 answers
  • A user calls your help desk to report that the files on her USB stick do not have any permissions associated with them and there
    15·2 answers
  • HIPAA requires the following controls for medical records: A. Encryption of all data B. Technical safeguards C. Physical control
    12·1 answer
  • Zach would like to reuse a spreadsheet that he created last year. However, he will need to delete the contents of several cells.
    5·1 answer
  • which feature of organisations to manage needs to know about to build and use information system successfully
    6·1 answer
  • Assume you are using the text's array-based queue and have just instantiated a queue of capacity 10. You enqueue 5 elements and
    13·1 answer
  • Please help with coding assignment.
    11·1 answer
  • ASAP 50 POINTS
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!