How to make same program for non-square matrix ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How to make same program for non-square matrix ?

https://code.sololearn.com/cx3xgnD4b0Uo/?ref=app

17th Mar 2022, 9:10 AM
Abhay mishra
Abhay mishra - avatar
7 Answers
+ 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
17th Mar 2022, 4:50 PM
Ipang
+ 2
You mean a matrix where each row have different number of columns?
17th Mar 2022, 10:14 AM
Ipang
+ 1
Ipang yes sir
17th Mar 2022, 10:41 AM
Abhay mishra
Abhay mishra - avatar
+ 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..
17th Mar 2022, 11:34 AM
Jayakrishna 🇮🇳
+ 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 😊☺️
17th Mar 2022, 5:25 PM
Abhay mishra
Abhay mishra - avatar
+ 1
Abhay mishra, I think just let the user define the matrix i.e what may it be 3x3 or 3x4.
18th Mar 2022, 4:27 AM
Jaswanth
Jaswanth - avatar
0
Without pointers if you need, see this: https://code.sololearn.com/cb71KiTN4K0t/?ref=app Hope it helps...
18th Mar 2022, 10:18 AM
Jayakrishna 🇮🇳