Constructing A Scalar Matrix using C
Hiii!! Hope y’all are fine and this post reaches you in the pink of your health❤
As it’s evident from the title today I’ll share how you can generate a scalar matrix in C. Well, just for your interest i was asked this for my comprehensive viva which i failed to answer. Sir was kind enough to divert me to other questions leading to a moderate lab experience but I hope you all don’t fall prey to that disgusting situation so here I am.
Enough of all these blabbering hope you know what a scalar matrix is. If not, I got you covered!
Scalar Matrix is basically that matrix you get after multiplying a scalar to an identity matrix.
So the logic I used was that
- I incorporated the logic for identity matrix and constructed it.
- Then after my code could create the matrix I used the logic of multiplication in array
- I allowed the user to put the input for scalar by using printf(“Enter the Scalar”); and used scanf to assess the user’s input.
- Then by multiplication of matrices with a scalar I got my desired result.
Source Code:
That’s it for today! Hope this enriched you!