Hello,
Can any one pls tell me how to get input form user for integer using array.. Pls help. I am just learning basics.
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Kirtan PatelPosted Feb 7, 2010, 11:03 AM
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();
}
}
}
Lalit MPosted Feb 7, 2010, 11:27 AM
http://dotnetperls.com/int-array
http://www.devasp.net/net/articles/display/672.html
more info you will get
romelevansPosted Feb 7, 2010, 10:50 AM
Romel Evans