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
Match the job titles to the tasks
bija089 [108]

creates storyboards based on clients’ needs- Animator


assesses proposals for airplane designs to determine if they meet standards- Aeronautical engineer


uses special equipment and techniques to capture images- Commercial Photographer


creates software code, graphics, and multimedia elements for websites- Webpage designer

5 0
3 years ago
Read 2 more answers
Subscribe to my you tube channel to get all your questions answered
vredina [299]

kaaaaaaaaaaaaaaaaa

aaa

4 0
3 years ago
The procurement department of an organization helps to program software. <br> A)True<br> B)False
valina [46]
I think it is true absolutely
8 0
3 years ago
Read 2 more answers
A high bandwidth gives you faster what
Nataly_w [17]
Results in faster speeds.
8 0
4 years ago
What will be the output of the following HLOOKUP formula on the table?
shutvik [7]

Answer:

i think that the answer is 103

Explanation:

4 0
4 years ago
Read 2 more answers
Other questions:
  • A ____ is a structure that allows repeated execution of a block of statements.
    13·2 answers
  • Which is the term for a computer typically located in an area with limited security and loaded with software and data files that
    9·1 answer
  • What is the definition of the components that motherboards, ssds, processors, and cases are part of?
    10·1 answer
  • Joining two or more objects in a publication is known as _____.
    15·2 answers
  • The first thing you should select if you're using an Address Block or Greeting Line is
    11·1 answer
  • Data owners ensure that only the access that is needed to perform day-to-day operations is granted and that duties are separated
    10·1 answer
  • The encapsulating security ______ protocol provides secrecy for the contents of network communications as well as system-to-syst
    14·1 answer
  • What is output? Select all that apply. c = 0 while (c &lt; 5): c = c + 1 print(c) 6 5 2 4 3 0 1
    9·1 answer
  • Xor meaning in computer science
    8·2 answers
  • Body positioning is an example of what type of communication?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!