Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <limits.h>
- int main()
- {
- int size;
- printf("Enter the size of matrix: ");
- scanf("%d",&size);
- float matrix[size][size];
- int mincolind, maxrowind;
- int minelement = INT_MAX;
- int maxelement = INT_MIN;
- printf("Enter the elements of matrix\n");
- for(int i=0;i<size;i++){
- printf("Enter the %d row: ",i);
- for (int j=0;j<size;j++){
- scanf("%f",&matrix[i][j]);
- if (minelement>matrix[i][j]){
- mincolind = j;
- minelement = matrix[i][j];
- }
- if (maxelement<matrix[i][j]){
- maxrowind = i;
- maxelement = matrix[i][j];
- }
- }
- }
- float mul = 1;
- for (int i=0;i<size;i++){
- mul*=matrix[i][mincolind];
- mul*=matrix[maxrowind][i];
- }
- printf("mul: %f", mul);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement