Create a C# program that uses array:
that accepts value and display.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Text.RegularExpressions;
namespace Arrays
{
class Program
{
static void Main(string[] args)
{
Console.Write("Enter the number elements: ");
int N = int.Parse(Console.ReadLine());
string []array=new string[N];
for (int i = 0; i < N; i++)
{
Console.Write("Enter the element[{0}]: ",i);
array[i]= Console.ReadLine();
}
for (int i = 0; i < N; i++)
{
Console.WriteLine("The element[{0}] is {1}: ", i, array[i]);
}
Console.ReadLine();
}
}
}
Comments
Leave a comment