Académique Documents
Professionnel Documents
Culture Documents
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication8
class Program
int m, n,i,j;
m = Convert.ToInt16(Console.ReadLine());
n = Convert.ToInt16(Console.ReadLine());
A[i, j] = Convert.ToInt16(Console.ReadLine());
B[i, j] = Convert.ToInt16(Console.ReadLine());
Console.Clear();
Console.WriteLine("\nMatrix A : ");
Console.Write(A[i, j] + "\t");
Console.WriteLine();
Console.WriteLine("\nMatrix B: ");
Console.Write(B[i, j] + "\t");
Console.WriteLine();
Console.Write(C[i, j] + "\t");
Console.WriteLine();
Console.Read();
}
-----------------------------------------------------------------------------
----------------------------------------------------
/*
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Program
class Program
int m, n, i, j;
m = Convert.ToInt16(Console.ReadLine());
n = Convert.ToInt16(Console.ReadLine());
A[i, j] = Convert.ToInt16(Console.ReadLine());
B[i, j] = Convert.ToInt16(Console.ReadLine());
}
Console.Clear();
Console.WriteLine("\nMatrix A : ");
Console.Write(A[i, j] + "\t");
Console.WriteLine();
Console.WriteLine("\nMatrix B: ");
Console.Write(B[i, j] + "\t");
Console.WriteLine();
}
Console.Write("\nDifference Matrix :");
Console.Write(C[i, j] + "\t");
Console.WriteLine();
Console.Read();
}
-----------------------------------------------------------------------------
----------------------------------------------------
/*
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Program
class Program
int m, n, i, j;
Console.Write("Enter the Order of the Matrix : ");
m = Convert.ToInt16(Console.ReadLine());
n = Convert.ToInt16(Console.ReadLine());
A[i, j] = Convert.ToInt16(Console.ReadLine());
Console.Clear();
Console.WriteLine("\nMatrix A : ");
Console.Write(A[i, j] + "\t");
Console.WriteLine();
Console.Write(A[j, i] + "\t");
}
Console.WriteLine();
Console.Read();
}
-----------------------------------------------------------------------------
----------------------------------------------------
/*
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
class interchangerow
int m, n;
int[,] a;
m = x;
n = y;
Console.WriteLine("a[{0},{1}]=", i, j);
a[i, j] = Convert.ToInt32(Console.ReadLine());
Console.WriteLine();
int i = Convert.ToInt32(Console.ReadLine());
int j = Convert.ToInt32(Console.ReadLine());
{
int temp = a[i - 1, k];
a[j - 1, k] = temp;
int x, y;
interchangerow obj;
x = Convert.ToInt32(Console.ReadLine());
y = Convert.ToInt32(Console.ReadLine());
obj.readmatrix();
obj.printmax();
obj.interchange();
obj.printmax();
Console.ReadLine();
}
-----------------------------------------------------------------------------
----------------------------------------------------
/*
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication8
{
class Program
int x;
int m, n, i, j;
m = Convert.ToInt16(Console.ReadLine());
n = Convert.ToInt16(Console.ReadLine());
A[i, j] = Convert.ToInt16(Console.ReadLine());
Console.Clear();
Console.WriteLine("\nMatrix A : ");
Console.Write(A[i, j] + "\t");
}
Console.WriteLine();
Console.Write("\n");
if (i <= j)
Console.Write(A[i, j] + "\t");
else
Console.Write("0\t");
Console.ReadLine();
}
-----------------------------------------------------------------------------
----------------------------------------------------
/*
*/
using System;
class pro
int i, j;
a[i, j] = Convert.ToInt16(Console.ReadLine());
goto label;
Console.WriteLine("Identity Matrix");
return;
label:
}
-----------------------------------------------------------------------------
----------------------------------------------------
/*
* C# Program to Find Largest Element in a Matrix
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
class arrsampl
int[,]x;
arrsampl()
void printarray()
Console.Write(x[i, j] + "\t");
Console.WriteLine("\n");
int max()
{
for (int j = 0; j < 3; j++)
return big;
obj.printarray();
Console.ReadLine();
}
-----------------------------------------------------------------------------
----------------------------------------------------
/*
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace matrix_multiplication
class Program
{
int i, j,m,n;
m = Convert.ToInt32(Console.ReadLine());
n = Convert.ToInt32(Console.ReadLine());
a[i, j] = int.Parse(Console.ReadLine());
Console.Write(a[i, j] + "\t");
Console.WriteLine();
{
for (j = 0; j < n; j++)
b[i, j] = int.Parse(Console.ReadLine());
Console.Write(b[i, j] + "\t");
Console.WriteLine();
c[i, j] = 0;
Console.Write(c[i, j] + "\t");
Console.WriteLine();
Console.ReadKey();
}
-----------------------------------------------------------------------------
----------------------------------------------------
/*
*/
using System;
using System.Collections.Generic;
using System.Text;
namespace matrix_row_sum
class mat
int i, j, m, n;
m = int.Parse(Console.ReadLine());
n = int.Parse(Console.ReadLine());
Console.WriteLine("Enter the Elements");
a[i, j] = int.Parse(Console.ReadLine());
Console.WriteLine("Given Matrix");
Console.WriteLine();
int r;
r = 0;
r = r + a[i, j];
class matrowsum
ma.getmatrix();
ma.row();
Console.ReadLine();
}
-----------------------------------------------------------------------------
----------------------------------------------------
/*
*/
using System;
using System.Collections.Generic;
using System.Text;
namespace matrix_col
class mat
int i, j, m, n;
m = int.Parse(Console.ReadLine());
n = int.Parse(Console.ReadLine());
a[i, j] = int.Parse(Console.ReadLine());
Console.WriteLine("Given Matrix");
Console.WriteLine();
int c;
c = 0;
for (j = 1; j <= m; j++)
c = c + a[j, i];
class matsum
ma.getmatrix();
ma.col();
Console.ReadLine();
}
-----------------------------------------------------------------------------
----------------------------------------------------
/*
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
class arrsampl
int[,]x;
arrsampl()
void printarray()
Console.Write(x[i, j] + "\t");
Console.WriteLine("\n");
int max()
}
return small;
obj.printarray();
Console.ReadLine();
}
-----------------------------------------------------------------------------
----------------------------------------------------
/*
*/
using System;
using System.Collections.Generic;
using System.Text;
class mat
int i, j, m, n;
m = int.Parse(Console.ReadLine());
n = int.Parse(Console.ReadLine());
a[i, j] = int.Parse(Console.ReadLine());
Console.WriteLine("Given Matrix");
Console.WriteLine();
int d;
d = 0;
if (m == n)
if (i == j)
d = d + a[i, j];
}
else
class matsum
ma.get();
ma.diag();
Console.Read();
}
-----------------------------------------------------------------------------
----------------------------------------------------
/*
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
class interchangecol
int m, n;
int[,] a;
m = x;
n = y;
a[i, j] = Convert.ToInt32(Console.ReadLine());
{
Console.Write("{0}\t", a[i, j]);
Console.WriteLine();
int i = Convert.ToInt32(Console.ReadLine());
int j = Convert.ToInt32(Console.ReadLine());
int x, y;
interchangecol obj;
x = Convert.ToInt32(Console.ReadLine());
y = Convert.ToInt32(Console.ReadLine());
obj.readmatrix();
obj.printmax();
obj.interchange();
obj.printmax();
Console.ReadLine();
}
-----------------------------------------------------------------------------
----------------------------------------------------
/*
*/
using System;
using System.Collections.Generic;
using System.Text;
class mat
int i, j, m, n;
m = int.Parse(Console.ReadLine());
n = int.Parse(Console.ReadLine());
a[i, j] = int.Parse(Console.ReadLine());
}
}
Console.WriteLine("Given Matrix");
Console.WriteLine();
int d;
d = 0;
if (m == n)
if (i == j)
d = d + a[i, j];
else
class matsum
ma.get();
ma.diag();
Console.Read();
}
-----------------------------------------------------------------------------
----------------------------------------------------
/*
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication8
class Program
int x;
public static void Main(string[] args)
int m, n, i, j;
m = Convert.ToInt16(Console.ReadLine());
n = Convert.ToInt16(Console.ReadLine());
A[i, j] = Convert.ToInt16(Console.ReadLine());
Console.Clear();
Console.WriteLine("\nMatrix A : ");
Console.Write(A[i, j] + "\t");
Console.WriteLine();
Console.Write("\n");
if (i >= j)
Console.Write(A[i, j] + "\t");
else
Console.Write("0\t");
Console.ReadLine();
}
-----------------------------------------------------------------------------
----------------------------------------------------