Matrix transpose

Posted by sameer on Wednesday, June 10, 2009 In : Matrix 
#include<iostream.h
#include<process.h
#include<conio.h
void main()
{
int a[10][10],b[10][10],rowa,cola,i,j;
cout<<"enter the number of rows=";
cinrowa;
cout<<"enter the number of coloumn=";
cincola;
cout<<"enter the elements of matrix A\n";
for(i=0;i<rowa;i++)
{
for(j=0;j<cola;j++)
{
cout<<"a["<<i<<"]["<<j<<"]"<<"=";
cina[i][j];
}
}
for(i=0;i<rowa;i++)
{
for(j=0;j<cola;j++)
{
b[i][j]=a[j][i];          //transposing
}
}
for(i=0;i<rowa;i++)
{
cout<<endl;
for(j=0;j<cola;j++)
{
cout<<b[i][j]<<" ";
}
}
}

for transposing a mat...
Continue reading...
 

Matrix multiplication

Posted by sameer on Wednesday, June 10, 2009 In : Matrix 
#include<iostream.h
#include<process.h
#include<conio.h
void main()
{
int a[10][10],b[10][10],c[10][10],rowa,cola,rowb,colb,i,j,k;
cout<<"enter the data for matrix A\n";
cout<<"enter the number of rows=";
cinrowa;
cout<<"enter the number of coloumns=";
cincola;
cout<<"enter the data for matrix B\n";
cout<<"enter the number of rows=";
cinrowb;
cout<<"enter the number of coloumns=";
cincolb;
if(cola!=rowb)                       //checking compatibility
{
cout<<"Matrix cannot be multipied\n";
exit(0);
}
c...

Continue reading...
 

Matrix subtraction

Posted by sameer on Wednesday, June 10, 2009 In : Matrix 
#include<iostream.h
#include<process.h
#include<conio.h
void main()
{
int a[10][10],b[10][10],c[10][10],rowa,cola,rowb,colb,i,j;
cout<<"enter the data for matrix A\n";
cout<<"enter the number of rows=";
cinrowa;
cout<<"enter the number of coloumns=";
cincola;
cout<<"enter the data for matrix B\n";
cout<<"enter the number of rows=";
cinrowb;
cout<<"enter the number of coloumns=";
cincolb;
if((rowa!=rowb)&&(cola!=colb))
{
cout<<"Matrix cannot be added\n";
exit(0);
}
cout<<"Matrix have same order and can be subtract...

Continue reading...
 
 

About Me


I AM KUNAL KUMAR SINGH AND IHAVE GREAT PROGRAMMING KNOWLEDGE WHICH I HAVE USED TO DESIGN THIS SITE . KINDY TAKE AS MUCH HELP AND INFO FROM MY SITE AS POSSIBLE .

 

DONATE  ANY AMOUNT FOR C++NOW 

Recent Posts