{
arrayInt1[i]=convert.toInt32(Console.ReadLine());
}
استفاده از حلقه foreach
foreach (int ab in b)
{
arrayInt2[i]=Convert.ToInt32(Console.ReadLine());
}
آرایه دو بعدی
نوع آرایه[,]نام آرایه ;
int[,] arrayInt3={{2,10,5},{400,33,7}};
int[,] arrayInt4=new int[3,5];
arrayInt4[2,1]=5;
استفاده از حلقه while و for
int i=0;
while(i<3)
{
for(int j=0; j<5; j++)
{
arrayInt4[i,j]= Convert.ToInt32(Console.ReadLine());
}
i++;
}
آرایه سه بعدی
int[,,] arrayInt5=new int[4,3,5];
arrayInt5[1,1,2]=5;
استفاده از حلقه for
for(int i=0; i<4; i++)
{
for(int j=0; j<3; j++)
{
for(int k=0; k<5; k++)
{
arrayInt5[i,j,k]=convert.toInt32(Console.ReadLine());
}
}
}
از مبتدي تا پيشرفته .... تدريس برنامه نويسي، رفع اشکال و اجراي پروژه توسط مؤلف کتب کامپیوتری و الکترونیکی . . . ASP .NET , C# , SQL , C++ , C , Delphi , VB