- using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
using System.Globalization;
using System.Data;
namespace ConsoleDemoApp
{
class MatrxTranspose
{
/* program to write a exception in c# */
public static void Main(string[] args)
{
int row, col, i, j;
Console.Write("Enter Number Of Rows and Columns Of Matrices A : ");
row = Convert.ToInt16(Console.ReadLine());
//Console.Write("Enter Number Of Columns Of Matrices A : ");
//col = Convert.ToInt16(Console.ReadLine());
col = row;
int[,] A = new int[row, col];
Console.Write("\nEnter The Matrix A: \n");
for (i = 0; i < row; i++)
{
for (j = 0; j < col; j++)
{
A[i, j] = Convert.ToInt16(Console.ReadLine());
}
}
//Console.Clear();
Console.WriteLine("\nOriginal Matrix A : ");
for (i = 0; i < row; i++)
{
for (j = 0; j < col; j++)
{
Console.Write(A[i, j] + "\t");
}
Console.WriteLine();
}
Console.Write("\nTranspose of Matrix A:\n");
for (i = 0; i < row; i++)
{
for (j = 0; j < col; j++)
{
Console.Write(A[j, i] + "\t");
}
Console.WriteLine();
}
Console.Read();
}
}
}
Saturday, 25 April 2015
Transpose of a given Matrix in c# asp.net
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment