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
After class, Anita and Bev make plans to study for their psychology exam together but cannot decide on a time or location. In ad
Paladinen [302]

Answer:

Option B; 30 SECONDS OR LESS.

Explanation:

Short-term memory, also known as primary or active memory, is the information we are currently aware of or thinking about.

When short-term memories are not rehearsed or actively maintained, they last mere seconds.

Most of the information kept in short-term memory will be stored for less than 30 seconds (approximately 20 to 30 seconds), but it can be just seconds if rehearsal or active maintenance of the information is not done.

Therefore, Anita likely will be able to retain the information in short-term memory, without additional processing, for 30 SECONDS OR LESS.

8 0
4 years ago
A type of computer usually has thousands of users. which of the following is most likely to be the type of computer?
Sunny_sXe [5.5K]
The macbook computer has about 9,000,000 gagets and in its websites about 80T links
4 0
3 years ago
Read 2 more answers
A(n) ________ backup backs up only the files on a computer that have changed since the last time a backup was performed.
alekssr [168]

Answer:

incremental

Explanation:

An incremental backup backs up only the files on a computer that have changed since the last time a backup was performed.

3 0
3 years ago
When you select an object in the Visual Studio Designer, the object's size, color, text, and other characteristics are displayed
harina [27]

Answer:

the main window if that`s not correct sorry

Explanation:

3 0
3 years ago
You're using disk management to view primary and extended partitions on a suspect's drive. the program reports the extended part
kodGreya [7K]

The best assumption to make is that there is a hidden partition and the drive needs to be further searched.

5 0
3 years ago
Other questions:
  • Google Ads was designed to deliver three things to every advertiser: relevance, control, and results. It provides relevance by c
    11·1 answer
  • Assume that the array monthSales of integers has already been declared and that its elements contain sales data for the 12 month
    13·1 answer
  • Which of the following is a typical concern for developers while using prototypes?
    6·2 answers
  • The ________ identifies staff reaction and response times as well as inefficiencies or previously unidentified vulnerabilities.
    5·1 answer
  • When you use information hiding by selecting which properties and methods of a class to make public, you are assured that your d
    14·1 answer
  • Write a program that reads a list of integers, and outputs whether the list contains all even numbers, odd numbers, or neither.
    5·1 answer
  • List at least 5 professions for people working in the Information/Communication<br> fields.
    10·1 answer
  • Search the link <br><br> gKuJXd3zYDc<br><br> Subscribe I have a vid premiering soon
    11·1 answer
  • Identify the parts of it, Give at least three web browser that you usually used to visit a website.​
    10·1 answer
  • Lenny is working as an apprentice to a typesetter. He has been told to sort different font stamps based on their type. Match the
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!