Accept and print the single dimensional array.
using System;namespace TestArray
{
class program
{
static void Main(string[] args)
{
int[] arr1 = new int[5];
Console.WriteLine("Enter the value for array:");
for(int i=0; i<5; i++)
{
arr1[i]= Convert.ToInt16(Console.ReadLine());
}
Console.WriteLine("Display the single dimensional array:");
foreach (int i in arr1)
{
Console.WriteLine(i);
}
Console.ReadKey();
}
}
}
gud work bro :D
ReplyDeletethankyou so much :)
Delete