Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people's questions, and connect with other people.

Have an account? Sign In

Captcha Click on image to update the captcha.

Have an account? Sign In Now

Sign In

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

Sorry, you do not have a permission to ask a question, You must login to ask question.

Forgot Password?

Need An Account, Sign Up Here
Tech Answered Logo Tech Answered Logo
Sign InSign Up

Tech Answered

Tech Answered Navigation

  • Home
  • Tutorials
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • About Us
  • Blog
  • Contact Us
Home / Questions /Q 4337
In Process
glenn
glenn

glenn

  • Australia
  • 9 Questions
  • 9 Answers
  • 0 Best Answers
  • 18 Points
View Profile
  • 0
glenn
Asked: April 27, 20232023-04-27T12:37:42+05:30 2023-04-27T12:37:42+05:30In: C Language

code for matrix multiplication in c

  • 0

i got a assignment to submit and want to learn code for matrix multiplication in c. can anyone drop code for matrix multiplication in c, with a example program and some easy explanation. Because as im New to C language looking for code for matrix multiplication in c.

c languagec# programmingcode for matrix multiplication in ccode for matrix multiplication in c 2023code for matrix multiplication in c that can be copiedcode for matrix multiplication in c with example programcode for matrix multiplication in c2024example program for matrix multiplication in cmatrix multiplication in c program pdfmatrix multiplication in c with different dimensionsprogram for matrix multiplication in c using arrays
  • 1
  • 571
  • 0
  • 0
Answer
Share
  • Facebook

    Related Questions

    • c keep asking for input how to write a program that asks user input
    • how to learn programming/coding from basic?
    • Write a console program to store employee number in C#
    • What's difference between getch() and getche()?
    • How to run graphics program in c?

    1 Answer

    1. nuny
      2023-04-27T12:53:25+05:30Added an answer on April 27, 2023 at 12:53 pm

      Here is the example program with code for matrix multiplication in c and the program below is easy to undersstand and you may copy this code and execute on your computer directly.

      #include <stdio.h>

      int main()
      {
      int a[10][10], b[10][10], product[10][10];
      int i, j, k, rows1, cols1, rows2, cols2;

      printf("Enter the number of rows and columns of first matrix: ");
      scanf("%d %d", &rows1, &cols1);

      printf("Enter the elements of first matrix:\n");
      for (i = 0; i < rows1; i++) {
      for (j = 0; j < cols1; j++) {
      scanf("%d", &a[i][j]);
      }
      }

      printf("Enter the number of rows and columns of second matrix: ");
      scanf("%d %d", &rows2, &cols2);

      if (cols1 != rows2) {
      printf("Matrices cannot be multiplied\n");
      return 0;
      }

      printf("Enter the elements of second matrix:\n");
      for (i = 0; i < rows2; i++) {
      for (j = 0; j < cols2; j++) {
      scanf("%d", &b[i][j]);
      }
      }

      // Initializing elements of product matrix to 0
      for (i = 0; i < rows1; i++) {
      for (j = 0; j < cols2; j++) {
      product[i][j] = 0;
      }
      }

      // Multiplying matrices
      for (i = 0; i < rows1; i++) {
      for (j = 0; j < cols2; j++) {
      for (k = 0; k < rows2; k++) {
      product[i][j] += a[i][k] * b[k][j];
      }
      }
      }

      // Printing the product matrix
      printf("Product of the matrices:\n");
      for (i = 0; i < rows1; i++) {
      for (j = 0; j < cols2; j++) {
      printf("%d ", product[i][j]);
      }
      printf("\n");
      }

      return 0;
      }

      You may ask for different sort of programming questions further and happy here to answer them and you may look at how to write a console program to store employee details on C#.

       

      • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp
    Leave an answer

    Leave an answer
    Cancel reply

    Browse

    Sidebar

    Ask A Question

    More Questions

    • Tech savvy

      c keep asking for input how to write a program

    • Mingle tap

      How do you find the factorial of a number in

    • Namrata

      What Is A "null Pointer Assignment" Error? What Are Bus

    • Hari

      What is OOPs concept in C++ with examples?

    • Samakshi baghel

      What is the use of github?

    • Samakshi baghel

      How to fix broken commit

    • shree

      in turbo c how to change the cursor

    • Rekha kumari

      How to print all characters from a string in C.

    Stats

    • Questions 1,985
    • Answers 2,097
    • Posts 12
    • Best Answers 73

    Related Questions

    • Tech savvy

      c keep asking for input how to write a program that asks

    • kushwanth

      how to learn programming/coding from basic?

    • Aniya

      Write a console program to store employee number in C#

    • shiv

      What's difference between getch() and getche()?

    • shiv

      How to run graphics program in c?

    Explore

    • Home
    • Communities
    • Questions
      • New Questions
      • Trending Questions
      • Must read Questions
      • Hot Questions
    • Polls
    • Tags
    • Badges
    • Users
    • Help

    Footer

    Recent Comments

    • shree on How to use philips citrus press juicer 25 watts Demo
    • kiran kumar85 on How To Insert Names Automatically in Excel Sheet With VBA Code
    • Satish on How To Insert Names Automatically in Excel Sheet With VBA Code
    • jameslaurence on alarm won’t go off while on facetime how to fix
    • jameslaurence on how to solve export problem in kinemaster
    Ask A Question

    Archives

    Tags

    laptop buying guide (1) limit google news notifications (1) printer buying guide (1) stop google news notifications (1) turn off google news notifications (1)

    Social media

    © 2023 @ Techanswered.com.
    Terms, Privacy policy & Sitemap.

    Insert/edit link

    Enter the destination URL

    Or link to existing content

      No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.