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
You have installed Windows Server 2016 on a new server and want to centralize user logons and security policies. What type of so
shusha [124]

Answer:

Directory Service

Explanation:

3 0
2 years ago
How do you create a logo on Adobe illustrator
artcher [175]
Idk idk idk idk if dub
7 0
3 years ago
In the early days of photography, cameras were limited to professional photographers because of the knowledge needed to work the
ki77a [65]
True  ------------------------------------------
8 0
3 years ago
Read 2 more answers
Question 7<br> What is the description of The Ribbon?
Aloiza [94]

Answer:

a flat or tubular narrow closely woven fabric (as of silk or rayon) used for trimmings or knitting. b : a narrow fabric used for tying packages. c : a piece of usually multicolored ribbon worn as a military decoration or in place of a medal. d : a strip of colored satin given for winning a place in a competition

7 0
3 years ago
This type of technology typically does NOT come with a keyboard or mouse for input.
anyanavicka [17]
The answer is C) tablet. You use the touch screen keyboard for that.
4 0
3 years ago
Read 2 more answers
Other questions:
  • Why do you think LinkedIn has become so popular?
    6·1 answer
  • In a right triangle, the square of the length of one side is equal to the sum of the squares of the lengths of the other two sid
    10·1 answer
  • What is the most effect way to include space after each paragraph
    14·1 answer
  • A switch operates in the OSI reference model __________ layer and uses the __________ address to forward packets.
    8·1 answer
  • Write a recursive function, replace, that accepts a parameter containing a string value and returns another string value, the sa
    5·1 answer
  • . Does Zuckerberg believe in the thought that “the endpoint is when you sell the
    15·1 answer
  • 50 Points! 25 Points Each! Please help ASAP! Will mark brainliest! See attached image.
    10·2 answers
  • A ________ topology uses more than one type of topology when building a network. crossover multiple-use fusion hybrid
    11·1 answer
  • Which coding term means to carry out a series of steps one after another?
    7·2 answers
  • Can someone help me get spotify premium
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!