|
|
|
|
|

| Author |
Message |
![[Post New]](/templates/default/images/icon_minipost_new.gif) 12 Aug 2008 23:04:58 IST
|
|
|
firstly i have not done C++ , so please answer this question in C language , use #include<stdio.h> and <conio.h> only
Q1)Form 2 , 2x2 matrix and add them to form a 3rd matrix
Q2)Write a program to find transpose of a 2x2 and 3x3 matrix
rates assured!!
|
|
|
|
![[Post New]](/templates/default/images/icon_minipost_new.gif) 14 Aug 2008 20:43:09 IST
|
|
|
transpose of matrix
#include<stdio.h>
#include<conio.h>
void main()
{
int a[2][2], b[2][2];
read(a);
transpose(a,b);
print(b);
getch();
}
read(m)
int m[][2];
{
int i, j;
for(i=0;i<2;i++)
for (j=0; j<2;j++)
scanf("%d", &m[i][j]);
}
transpose(a,b)
int a[][2], b[][2];
{
int i, j;
for(i=0;i<2;i++)
for (j=0; j<2;j++)
{
b[j][i]=a[i][j];
}
}
print(m)
int m[][2];
{
int i,j;
for(i=0;i<2;i++)
{
for (j=0; j<2;j++)
printf("%d ", m[i][j]);
printf("\n");
}
}
pls rate......
|
this reply: 5 points
(with 1 
in 1 votes ) [?]
|
|
You have to be logged on to rate
|
|
|
![[Post New]](/templates/default/images/icon_minipost_new.gif) 14 Aug 2008 20:44:15 IST
|
|
|
for 3X3, replace 2 with 3 in the program
|
this reply: 2 points
(with 0 
in 1 votes ) [?]
|
|
You have to be logged on to rate
|
|
|
![[Post New]](/templates/default/images/icon_minipost_new.gif) 18 Aug 2008 17:48:06 IST
|
|
|
hmmmmmmmmmmm................ok......................now..................see...................i am not trying to find fault or something i have not gone through the code fully but i am sure that it will give more than1 error when it is compiled..........can any 1 tell the reason....
|
this reply: 0 points
(with 0 
in 0 votes ) [?]
|
|
You have to be logged on to rate
|
|
|
|
|
|
|
|
|
|