I'm trying to ask the user to enter the number of columns and rows that they want in the matrix, and then enter the values ββin the matrix ... I'm going to let them insert numbers one row at a time.
How to create such a function?
#include<stdio.h> main(){ int mat[10][10],i,j; for(i=0;i<2;i++) for(j=0;j<2;j++){ scanf("%d",&mat[i][j]); } for(i=0;i<2;i++) for(j=0;j<2;j++) printf("%d",mat[i][j]); }
This works for entering numbers, but displays them all on one line ... The problem here is that I donβt know how many columns or rows the user needs, so I canβt print% d% d% d in matrix form ...
Any thoughts?
Thanks:)
Nled source share