hi!
i wrote this program in c and this is the line that the code blocks gave me when i did build to the program. i couldn't understand what is the problem and this is why i'm looking for help from you all... thank you, i need to submit the project on sunday...
i wrote this program in c and this is the line that the code blocks gave me when i did build to the program. i couldn't understand what is the problem and this is why i'm looking for help from you all... thank you, i need to submit the project on sunday...
Code:
#include <stdio.h> #define N 20 #define M 20 int main() { int x,y,j,k,w,inner,numrow,clmnum,matrix[N][M],mtrxsum,minmtrx; printf("Enter num of rows (up to 20 rows) \n"); scanf("%d",&numrow); printf("Enter num of columns (up to 20)\n"); scnaf("%d",&clmnum); printf("enter matrix of size %dX%d, row after row :\n",numrow,clmnum); for (x=0;x<numrow;x++) { for (y=0;y<clmnum;y++) scanf("%d",&matrix[x][y]); mtrxsum+=matrix[x][y]; } if (numrow>clmnum) inner=(clmnum-1)/2; else inner=(numrow-1)/2; for (w=0;w<inner;w++) { minmtrx=0; for (j=1;j<(numrow-1);j++) { for(k=1;k<(clmnum-1);k++) minmtrx+= matrix [j] [k]; if ((mtrxsum-minmtrx)-minmtrx==0) printf("min width of requested perimeter is : %d",w); printf("The sum of its elements is : %d",minmtrx); } printf("Not found such a perimeter_width"); } return 0; }
Comment