Constructing A Scalar Matrix using C

PhiWhyyy!?!
2 min readOct 21, 2022

--

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.

Created on TexMath; here k is the scalar

So the logic I used was that

  1. I incorporated the logic for identity matrix and constructed it.
  2. Then after my code could create the matrix I used the logic of multiplication in array
  3. 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.
  4. Then by multiplication of matrices with a scalar I got my desired result.

Source Code:

That’s it for today! Hope this enriched you!

--

--

PhiWhyyy!?!
PhiWhyyy!?!

Written by PhiWhyyy!?!

Math Grad||Research Enthusiast||Interested in Mathematics & Cosmos<3 |Open to paid gigs >dm https://www.linkedin.com/in/sreyaghosh99/

No responses yet