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
PLEASE HELP ME!!!!!
gizmo_the_mogwai [7]

Answer:

Unicode

Explanation:

This is a fairly large code and Is well known throughout my family since we study ancient codex and modern codes to solve crimes and find relics of the past, although our research has proven good and unicode is one that is being studied currently now, I have found it as long and very time consuming. Although ASCII is a computer code that consists of graphs and numbers it actually shortens the text. and hexadecimal has been proven to be less reliable and binary is a short code with little symbols

8 0
3 years ago
Read 2 more answers
How do I delete my Brainly account?
Triss [41]

Answer:

yeah how? please tell me

Explanation:

5 0
2 years ago
Read 2 more answers
To store non-duplicated objects in the order in which they are inserted, use:______
Umnica [9.8K]

Answer:

b. LinkedHashSet

Explanation:

A LinkedHashSet is an ordered version of HashSet that maintains a doubly-linked List across all elements. When the iteration order is needed to be maintained this class is used. LinkedHashSet maintains a linked list of the entries in the set, in the order in which they were inserted.

4 0
3 years ago
The typing area is bordered on the right side by bars in ms word
lidiya [134]

Answer:

Explanation:

PTA NHI

6 0
3 years ago
Which of the following symbols would not be seen in the syntax for Java variables, methods, or arguments?
Taya2010 [7]

Answer:

??

Explanation:

?? is invalid syntax

When declaring or initializing variables names, and when writing methods, or arguments ?? is not used in Java .

() [] {} all these are used with variables , methods or arguments.

4 0
3 years ago
Other questions:
  • Identify the six components of an information system. Which are most directly affected by the study of computer security? Which
    8·1 answer
  • Write multiple if statements. if caryear is 1969 or earlier, print "probably has few safety features." if 1970 or higher, print
    6·1 answer
  • Which of the following best describes a good role model?
    6·2 answers
  • In an AND truth table.
    7·1 answer
  • Harrison works in a manufacturing unit and oversees the logistics, including the daily shipping of a large number of packages. W
    12·2 answers
  • Relation between training and occupation with examples in points . Plz tell fast<br> ​
    5·1 answer
  • 10. Question<br> What are the drawbacks of purchasing something online? Check all that apply.
    5·1 answer
  • When preparing a technical document, do all of the following EXCEPT:_______.
    12·1 answer
  • Write the use of these computers.
    14·1 answer
  • Explain four features of presentation packages​
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!