Array
using System;
using System.IO;
using System.Linq;
using System.Collections.Generic;
namespace CSharp_Shell
{
public class Program
{
public static void Main()
{
/*
//Array Sort
int[] myArray = new int[5];
//
for (int i = 0; i < myArray.Length; i++)
{
Console.Write("Enter Number{0} : ", i + 1);
myArray[i] = int.Parse(Console.ReadLine());
}
//
foreach (int num in myArray)
{
Console.WriteLine(num);
}
Console.WriteLine();
//
Array.Sort(myArray);
//
foreach (int num in myArray)
{
Console.WriteLine(num);
}
*/
/*
//Copy first array to second
int[,] myArray1 = new int[2, 2];
int[,] myArray2 = new int[2, 2];
//
TakeInput(myArray1);
PrintArray(myArray1);
PrintArray(myArray2);
CopyArray(myArray1, myArray2);
PrintArray(myArray1);
PrintArray(myArray2);
*/
//
/*
//Reverse Name
string name;
name = Console.ReadLine();
int length = name.Length;
char[] reverseName = new char[length];
//
for (int i = length - 1, j = 0; i >= 0; i--, j++)
{
reverseName[j] = name[i];
}
//
foreach (char x in reverseName)
{
Console.Write(x);
}
*/
}
/*
public static void PrintArray(int[,] myArray)
{
foreach (int num in myArray)
Console.WriteLine(num);
Console.WriteLine();
}
public static void TakeInput(int[,] myArray)
{
for (int i = 0; i < 2; i++)
{
for (int j = 0; j < 2; j++)
{
Console.WriteLine("Enter number{0},{1}: ", i, j);
myArray[i, j] = int.Parse(Console.ReadLine());
}
}
}
public static void CopyArray(int[,] myArray1, int[,] myArray2)
{
for (int i = 0; i < 2; i++)
{
for (int j = 0; j < 2; j++)
{
myArray2[i, j] = myArray1[i, j];
}
}
}
*/
}
}
Comments
Post a Comment