Free help with homework

Why join Brainly?

  • ask questions about your assignment
  • get answers with explanations
  • find similar questions

Write a user defined function named lowerhalf() which takes a 2D array A, with size n rows and n cols as arguments and prints the lower half of the matrix




This Is a Certified Answer

Certified answers contain reliable, trustworthy information vouched for by a hand-picked team of experts. Brainly has millions of high quality answers, all of them carefully moderated by our most trusted community members, but certified answers are the finest of the finest.
// i suppose it is a square matrix... lower and upper half...
#define  m  10
#define n 10

#include <iostream>

int main()
   int  i,j, A[m][n];

       lowerhalf(int &A[0][n], m, n);
     return 1;

void lowerhalf(int **A, int m, int n)
    int i, j;
        for (i = 0; i < m; i++) {    // in each row print as many as the row number
            for (j  =0; j < i ; j++)  cout << A[i][j]  << " " ; 
            cout << '\n';

1 5 1
click on thanks button above please
The Brain
  • The Brain
  • Helper
Not sure about the answer?
Learn more with Brainly!
Having trouble with your homework?
Get free help!
  • 80% of questions are answered in under 10 minutes
  • Answers come with explanations, so that you can learn
  • Answer quality is ensured by our experts