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
Mamont248 [21]
2 years ago
14

(20 points). Some matrixes have very special patterns, for example, in the following matrix, the numbers in the first row are eq

ual to the number of their respective column; the numbers in the first column are equal to the square of the number of their respective row; when the row number equals to the column number, the elements are equal to 1; the rest elements are the sum of the element just above them and the one to their left. Write a user-defined function program in the program, you need to use while loops), and then use the function you write to create the following matrix (show the command you use). 1 4 9 16 2 1 10 26 3 4 1 27 4 5 8 13 9 22 1 23
Computers and Technology
1 answer:
Nostrana [21]2 years ago
3 0

Answer:

#include <iostream>

using namespace std;

void matrix(){

   int row = 5, col = 6;

   int myarr[row][col];

   for (int i = 0; i < 5; i++){

       for (int x = 0; x < 6; x++){

           if (i == 0){

               myarr[i][x] = (x+1)*(x+1);

          }else if ( x == 0){

               myarr[i][x] = (i+1)*(i+1)*(i+1);

           } else if ( i == x){

                myarr[i][x] = (i+1);

           } else{

                myarr[i][x] = myarr[i-1][x] + myarr[i][x-1];

           }

        }

   }

   for (int i = 0; i < 5; i++){

       for (int x = 0; x < 6; x++){

           cout<< myarr[i][x] << " ";

       }

       cout<< "\n";

}

}

int main(){

   matrix();

}

Explanation:

The C++ source code defines a two-dimensional array that has a fixed row and column length. The array is a local variable of the function "matrix" and the void function is called in the main program to output the items of the array.

You might be interested in
To specify your preferred colors, fonts, and effects for a document, which of the following should be done?
Irina-Kira [14]

Answer: crest custom theme

Explanation:

8 0
2 years ago
Read 2 more answers
Type the correct answer in the box. Spell all words correctly. Complete the sentence below that describes an open standard in vi
Anika [276]

Answer:

digital

Explanation:

Today, video production has become digital, and all playback devices work on the open standard known as digital technology.​

8 0
3 years ago
Which is usually the smallest computer?
WITCHER [35]
I would have to say it would be a PDA, because they generally arent much bigger than a cell phone. at least mine is pretty small anyway. there are certain brands that make larger ones almost the size of a tablet, but in general terms, PDAs are usually pretty small. hope this helps.
7 0
2 years ago
Jacob would like to include an arrow in his newsletter to point to some important information. He should _____.
qwelly [4]

Some people either add a shape as I do. But for this particular question it would be, either add word art or create a list with bullets. I would rather do word art or insert shape because that means you do not have to get the single bullet.


I really do hope this helped you. I hope you have a great day. And if I am incorrect I apologize.

3 0
3 years ago
Read 2 more answers
What a suitable variable name to store the number of years old a person is
navik [9.2K]

age is a suitable variable name. It's descriptive and concise. Make sure it's lowercase.

8 0
3 years ago
Other questions:
  • Florida convicted __________ people of DUI in a one-year period from 2009 to 2010.
    15·1 answer
  • A plan that outlines the steps and timeline for reaching a certain goal is called a(n):
    13·1 answer
  • Why would a brokered CD pay more than a regular CD?
    13·1 answer
  • A communications objective is:
    12·1 answer
  • Why should the drives be segregated in a computer?​
    15·1 answer
  • A _______ template is used to maintain consistency in terms of margins and page numbers .
    6·1 answer
  • A popular photo editing application provides customers with the option of accessing a web based version through a monthly subscr
    11·1 answer
  • Decrypt this message: P ht uva h zwf
    13·1 answer
  • Suppose cell C5 contains the formula =B$6+C1.
    6·1 answer
  • What are acenders? What are decenders?
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!