Radical Developers welcomes all the visitors to be a member of the team. Come join us. Its all about open-source concept. All Programs are written and tested in MacOS X, Unix, Linux and may not match with the outputs of Turbo C++ in Windows
Showing posts with label Matrices (C). Show all posts
Showing posts with label Matrices (C). Show all posts

Sunday, January 9, 2011

Write a Program to add any two 3x3 matrices.


Source Code :

#include<stdio.h>
void main()
{
      int a[3][3],b[3][3],c[3][3],i,j;
      clrscr();
      printf("\nEnter Matrix A : ");

Write a program to multiply any two 3x3 matrices.

Source Code :

#include<stdio.h>
void main()
{
      int a[3][3],b[3][3],c[3][3],i,j;
      clrscr();
      printf("\nInput Matrix A : ");
      for(i=0;i<3;i++)

Tuesday, January 4, 2011

Write a C Program to Multiply Two Matrices


Source Code :

#include<stdio.h>
void main()
{
      int a[10][10],b[10][10],c[10][10],i,j,m,n,p,q;
      clrscr();
      printf("\nEnter Row & Column of Matrix A : ");
      scanf("%d %d",&m,&n);   //Input of row & column of Matrix A
      printf("\nEnter Row & Column of Matrix B : ");
      scanf("%d %d",&p,&q);   //Input of row & column of Matrix B
      if(n==p)    //If-else checking whether Matrix can be multiplied
      {
            printf("\nMatrix can be Multiplied\n");
            printf("\nInput Matrix A : ");
            for(i=0;i<m;i++)
            {
                  for(j=0;j<n;j++)
                  {
                        scanf("%d",&a[i][j]);   //Input in Matrix A
                  }
            }