Skip to content
Discussion options

You must be logged in to vote

#include <stdio.h>
#include <stdlib.h>

int minimum_cost(int matrix[], int t) {
int x, small;
small = matrix[0];
for (x = 1; x < t; x++) {
if (matrix[x] < small)
small = matrix[x];
}
return small;
}

int main() {
int limit, i, j, k, l, t;
int matrix[30], multiplier[10][10] = {0}, columns[10], rows[10], temp[10];

printf("\nEnter Total Number of Matrices: "); 
scanf("%d", &limit); 

// Input matrix dimensions and validate 
for (i = 0; i < limit; i++) { 
    printf("\nEnter Number of Rows of Matrix %d: ", i + 1); 
    scanf("%d", &rows[i]); 

    if (i > 0 && rows[i] != columns[i - 1]) { 
        printf("Error: Number of rows of Matrix %d does not match the number of 

columns of Matrix %d.\n"…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Soumilgit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants