Hello,
Can any one pls tell me how to get input form user for integer using array.. Pls help. I am just learning basics.
Array in C Sharp
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Kirtan PatelRank #292 · 8.6K reputationPosted Feb 7, 2010, 6:03 AM EST
Here is Code For that
---------------------
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
//Define Array
int[] x = new int[5];
// Get Input From User
for (int i = 0; i < 5; i++)
{
Console.WriteLine("Enter Value :");
x[i] = int.Parse(Console.ReadLine());
}
// Print the Array
Console.WriteLine("----Printing Array -----");
for (int i = 0; i < 5; i++)
{
Console.WriteLine(x[i].ToString());
}
Console.ReadKey();
}
}
}
romelevans16 reputationPosted Feb 7, 2010, 5:50 AM EST
Romel Evans
Lalit MRank #1,186 · 1.5K reputationPosted Feb 7, 2010, 6:27 AM EST
http://dotnetperls.com/int-array
http://www.devasp.net/net/articles/display/672.html
more info you will get