#include <iostream> #include <stdlib.h> #include <time.h> using namespace std; void llena_tabla(int t[][50],int f, int c) { srand(time(NULL)); int i,j; for (i = 0;i<f;i++){ for(j=0;j<c;j++){ t[i][j]= 10 + rand()% + (21-10); } } } void ver_tabla(int t[][50],int f, int c) { int i,j; for (i = 0;i<f;i++){ for(j=0;j<c;j++){ cout<<t[i][j]<<"\t"; } cout<<"\n"; } } int diagonal_principal(int t[][50],int f, int c,int &suma) { int i,j,mayor; mayor = t[0][0]; for(i=0;i<f;i++){ for(j=0;j<c;j++) { if(i==j){ cout<<t[i][j]; suma+=t[i][j]; if(t[i][j]> mayor) mayor = t[i][j]; } else{ cout<<"\t"; } } cout<<"\n"; } return mayor; } string diagonal_inferior(int t[][50],int f, int c) { int i,j; string diagonal = ""; for (i = 0 ; i<f;i++){ for (j=0;j<c;j++) { if(i+j == (f-1)){ diagonal += to_string(t[i][j]) + "\t"; } else{ diagonal += "\t"; } } diagonal += "\n"; } return diagonal; } void imprime_diagonales(int t[][50], int f, int
include<iostream> using namespace std; // Function to print the matrix void displayMatrix(int mat[][50], int f, int c) { for (int i = 0; i < f; i++) { for (int j = 0; j < c; j++) printf("%2d ", mat[i][j]); printf("\n"); } printf("\n"); } // Function to get the transpose of the matrix void getTranspose(int M[][50], int MT[][50], int f, int c) { for (int i = 0; i < f; i++) for (int j = 0; j < c; j++) MT[j][i] = M[i][j]; } // Function to get the upper traingular matrix void getUpperTriangular(int M[][50], int UT[][50], int f, int c) { for (int i = 0;