hi everyone..i don t know about c# language..so can u plz help me to convert c++ to c# code??
my code is
#include<STDIO.H>
#include<CONIO.H>
main()
{
int m, n, p, c, d, k, sum = 0;
int matrix[10][10], transpose[10][10], product[10][10];
cout<<"Enter the number of rows and columns of matrix\n";
cin>>"%d%d",&m,&n;
cout<<"Enter the elements of matrix\n";
for ( c = 0 ; c < m ; c++ )
for ( d = 0 ; d < n ; d++ )
cin>>"%d",&matrix[c][d];
for( c = 0 ; c < m ; c++ )
{
for( d = 0 ; d < n ; d++ )
{
transpose[d][c] = matrix[c][d];
}
}
for ( c = 0 ; c < m ; c++ )
{
for ( d = 0 ; d < n ; d++ )
{
for ( k = 0 ; k < n ; k++ )
{
sum = sum + matrix[c][k]*transpose[k][d];
}
product[c][d] = sum;
sum = 0;
}
}
for ( c = 0 ; c < m ; c++ )
{
for ( d = 0 ; d < m ; d++ )
{
if ( c == d )
{
if ( product[c][d] != 1 )
break;
}
else
{
if (product[c][d] != 0 )
break;
}
}
if ( d != m )
break;
}
if ( c != m )
cout<<"Matrix is not orthogonal.\n";
else
cout<<"Matrix is orthogonal.\n";
getch();
return 0;
}
my code is
#include<STDIO.H>
#include<CONIO.H>
main()
{
int m, n, p, c, d, k, sum = 0;
int matrix[10][10], transpose[10][10], product[10][10];
cout<<"Enter the number of rows and columns of matrix\n";
cin>>"%d%d",&m,&n;
cout<<"Enter the elements of matrix\n";
for ( c = 0 ; c < m ; c++ )
for ( d = 0 ; d < n ; d++ )
cin>>"%d",&matrix[c][d];
for( c = 0 ; c < m ; c++ )
{
for( d = 0 ; d < n ; d++ )
{
transpose[d][c] = matrix[c][d];
}
}
for ( c = 0 ; c < m ; c++ )
{
for ( d = 0 ; d < n ; d++ )
{
for ( k = 0 ; k < n ; k++ )
{
sum = sum + matrix[c][k]*transpose[k][d];
}
product[c][d] = sum;
sum = 0;
}
}
for ( c = 0 ; c < m ; c++ )
{
for ( d = 0 ; d < m ; d++ )
{
if ( c == d )
{
if ( product[c][d] != 1 )
break;
}
else
{
if (product[c][d] != 0 )
break;
}
}
if ( d != m )
break;
}
if ( c != m )
cout<<"Matrix is not orthogonal.\n";
else
cout<<"Matrix is orthogonal.\n";
getch();
return 0;
}