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
How can a user preview the playback of an audio clip in PowerPoint? Use the drop-down menus to complete the statements.
tresset_1 [31]

Answer:

<em>Playback</em>

<em>Preview</em>

<em>Slide show</em>

<em>From Current Slide</em>

Explanation:

7 0
3 years ago
Compare and contrast the leadership and leadership and management style of apple and Samsung ​
Ipatiy [6.2K]

Answer:

Samsung's business model has focused on vertically integrating supply chains and ramping up production volume. Apple has made a business strategy of focusing on design and user experience while outsourcing elements such as manufacturing. The two companies have found themselves engaged in legal battles over intellectual property and patent fights.

Hope this helps!

4 0
2 years ago
To paste text with the same formatting as the document in which it is entered, select _____ from the Paste menu. Keep Source For
SashulF [63]
Copy by command c and paste by command v
5 0
3 years ago
Read 2 more answers
Assume that printStars is a function that takes one argument and returns no value. It prints a line of N stars (followed by a ne
trasher [3.6K]

Answer:

printStars(35);

Explanation:

public class Question {

   public static void main(String args[]) {

     printStars(35);

   }

   public static void printStars(int numberOfStars){

       for(int i = 1; i <= numberOfStars; i++){

           System.out.print("*");

       }

       System.out.print("\n");

   }

}

7 0
3 years ago
Which soft skills would these mobile app developers need to use in the situations described?
Ber [7]

Answer:

1: work ethic/presentation.

2: communication.

3: adaptability.

4: creativity.

(these are all guesses so i'm not 100% sure)

Explanation:

6 0
2 years ago
Read 2 more answers
Other questions:
  • Write a program that estimates the approximate number of times the user’s heart has beat in his/her lifetime using an average he
    12·1 answer
  • Comparing tools made of stone, iron, and bronze: place them in the correct order from least to most durable
    14·1 answer
  • By which method is heat transferred through a metal <br> spoon?
    9·2 answers
  • What is the exact number of bits in a memory that contains (a) 128k bits?
    9·1 answer
  • Jason Has A Science Video Project, As He Creats His Project, He Saves, Then Comes Back A Minute Later. The File Is Now Unreadabl
    8·2 answers
  • Program: ASCII art (Python 3)1) Output this tree. 2) Below the tree (with two blank lines), output this cat. (3 pts) /\ /\ o o =
    8·1 answer
  • Literally no one helps answer my questions so this website is pointless.... : /
    11·1 answer
  • Function of pons for class 7​
    15·1 answer
  • Identify the correct answer in each item. Write your answer on the blank provided before
    13·1 answer
  • Think of some local businesses that have websites. Look online and identify two different websites for businesses or services in
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!