+ 1
How to make same program for non-square matrix ?
7 odpowiedzi
+ 3
Hello Abhay,
Well I finally made it, this is an interesting practice ...
Idk what you'll think of it, it's a lot bigger (in terms of lines) but well, this is just one of the ways I thought it could be done : )
If there's a doubt, you are welcome to ask. Anyone here (including me), will try to answer, as time permits.
https://code.sololearn.com/cLZnnfqqZRAz/?ref=app
+ 2
You mean a matrix where each row have different number of columns?
+ 1
Ipang yes sir
+ 1
Ex: take variables r for row value and c for column value.
Declare array like
int arr[n][m] ; //or enough length
Now loop conditions are i<n and j<m ; i of outer loop, j is inner loop variables.
but find rows sum and column sum with different loops, I think. Remain works same.
Hope it helps..
+ 1
Ipang thanks sir you have done for me . But i am learning c so some of concept like size i haven't learned till now . So after learning this i will able to understand this . But ya thank you once again 😊☺️
+ 1
Abhay mishra, I think just let the user define the matrix i.e what may it be 3x3 or 3x4.
0
Without pointers if you need, see this:
https://code.sololearn.com/cb71KiTN4K0t/?ref=app
Hope it helps...