???? ????
??????? ???? ????? ???????? ? ????? ?????? ??? ??? ???
??? ???? ? ?????? ?? ???? ??? ???? ???? ???? ?? ???? ??? ??? ?? ???? ???????? (????? ?????? ????? ????????) ?? ?????? ??? ????? ??????? ??????. ?? ??? ????? ??? ??? ?????? ?? ?????? ?????? ?? ?????? ???? ...
Download Firefox
Download Safari
Chrome browser download link is disabled!
Download Flock
Download Opera
???? ??? ?? ????? ????
????? ??????
ما 13 مهمان آنلاین داریم
???? ?????? ?? ????

?????? ????? ?????:5
????? ??????? ?????:12
?????? ????? ?????:4
?????? ????? ??? ???:106
?????? ????? ??:33868
????? ??????? ??:159006
??????? ?????? ???:1383
Date since:2009-03-05
???? ?? ????

postheadericon ??? ????? ?????? ???? ?? #C

??? ?????? ???? ????? ??? ??? ?? ????? ?? ?? ?? ????? ?? ???? ????

???????  ?????

?? ??? ????? ??? ?????? ????? ?? ???? ????  ????????? ??    ??????? goto   ????? ????. ?? ??? ?? ??? ?????? ??? ???? ????? ???? ?? #C ????. ??????? ????? ??? ?? ??? ??? ?? ??? ??? ????? ?? ???? ???? ????  ????? ??????? ?? ??????? ???? ???  ????? #C ?? ??? ????? ???.

??? ?? ?? ??? ??? ??? ????? ???? ??? ??? ???

v    ??????? ???? ????? while

v    ??????? ???? ????? do

v    ??????? ???? for

v    ???????  ???? foreach

????? While

??? ??? ??????? ?? ????? while   ???? ??? :                                      {??????? } ( ????? ?????) while

????? ???? ????? ????? ??????? ??? ?? ????? ?? ????? ????? ???? (true) ??????? ??? ??????? ???? ?????? ??

????? ????? ????? ??????? ???? ?????? ????? ?????? ?? ?? ???? ???? ???? ??????? ???? ?????? ????? ????? ???? ? ?????? ???? ????? ??????? ?? ??? ???? ???? ?????? ??. ?????? ?? ????? ????? ??? ??????? ?? ??? ??????? ???? ????? while ?????? ????? ?? ???? ? ???? ?? ??? ?? ?????? ???? ???? ???? ???? ?? ???.

??? ?? ????? ???? ????? ???? ????? ???? ?? ???? ??????? ???? ?? ????? ?? ????? ????? ???? ?????. ?????? ?? ???? ???? ????? ???? ????? ????? ????? ?? ??? ?? ??????? ?? ???? ?????? ?? ???? ???? ???? ???? ??????? ?? ???? ??? ??? ??? ???? ?? ????? ?? ????? ?? ???? ???. ?????? 1-4 ?????? ????? ?? ???? while ?? ????? ?? ???

?????? 1-4 ???? while

using System;

class WhileLoop
{
public static void Main()
{
int myInt = 0;

while (myInt < 10)
{
Console.Write("{0} ", myInt);
myInt++;
}
Console.WriteLine();
}
}

??? ?????? ?? ???? while ???? ?? ???? ???? ??? ?? ?? ???? ????? while ???? ?? ??? ??? ?? ?? ?? ????? ????? ????? ?? ??? ????? ????  ??????  myInt ?? ????? ????? ?? ????? ??? ?? ?? ???? ??? ?

?? ???? ?? ?? ??? ????? ??? ??? ??? ???? ????? ????? ??????? ??? ???? ???? ???? ???????? ???? ????? ??. ?? ???? ???? while ?? ?? ?? ??? ?? ????. ??? ?? ????? myInt ?? ?? ???? ?????? ?? ????. ????? ?? ?????? ???? ????? ???? ????? ????? ?????? ??????? ?? ??? ??????? ?? ????? ??????? ??? ????? ????? ???? ?? True ??? ?????? ??????? ???? ?????? ???? ??? ? ?? ?????????? ????? ????? ?????? ?? ????? ?????? ???? ??? ?? ????.

???? do  

?? ???? do ????? ???? while ??? ??? ???? ????? ?? ?????? ???? ??????? ?? ????. ?? ??? ???? ?? ???? do ????? ????? ???? ?? ???.

?? ???? ?? ??? ???? ??? ??????? ?? ????   do ?? ??? ???? while  ??????? ???? ????? ?? ????? ?? ????? ??????? ????? ?????? 2-4 ? ??? ?????? ?????  ?? ?? ????? ??? .

?????? 2-4 ???? Do

using System;

class DoLoop
{
public static void Main()
{
string myChoice;

do
{
// Print A Menu
Console.WriteLine("My Address Book\n");

Console.WriteLine("A - Add New Address");
Console.WriteLine("D - Delete Address");
Console.WriteLine("M - Modify Address");
Console.WriteLine("V - View Addresses");
Console.WriteLine("Q - Quit\n");

Console.WriteLine("Choice (A,D,M,V,or Q): ");

// Retrieve the user's choice
myChoice = Console.ReadLine();

// Make a decision based on the user's choice
switch(myChoice)
{
case "A":
case "a":
Console.WriteLine("You wish to add an address.");
break;
case "D":
case "d":
Console.WriteLine("You wish to delete an address.");
break;
case "M":
case "m":
Console.WriteLine("You wish to modify an address.");
break;
case "V":
case "v":
Console.WriteLine("You wish to view the address list.");
break;
case "Q":
case "q":
Console.WriteLine("Bye.");
break;
default:
Console.WriteLine("{0} is not a valid choice", myChoice);
break;
}

// Pause to allow the user to see the results
Console.Write("press Enter key to continue...");
Console.ReadLine();
Console.WriteLine();
} while (myChoice != "Q" && myChoice != "q"); // Keep going until the user wants to quit
}
}

????? ???? ?? ?? ???? ); ????? ????? While(        {???????  Do {    ?? ????.

?????? ??? ???? ??? ??????? While ? Do---While ?? ??? ??? ?? ?? ??? ??? ??????? ???? ???? ????? ????? ???? ?? ????.

???? For

?? ???? for ?????? ?? ???? while ??? ????? ????? ????? ?? ????? ??????????? ???? ????? ??? ????? ? ?????? ???? ????? ????? ???? ???? ???. ??????? For ???? ????? ????? ????? ?? ??? ????? ?? ????? ??? ???? ??????? ???? ???? ?? ?????? ???? ????.

?????? ???? ????????? ???? ??? For ?? ?? ???? ??????? ?? ????? ???? ?????? ?? ??? ????? ?? ????. ???????? ???? ??? ??? ????? ????? ??? ???:

For) ????? ????? ????? ???? ; ??? ???? ; ??? ????) { <?????? ???????> }.

?????? ????? ????? ???? ?? ??? ??? ???? ???? ????? ??????? ?????? ??? ??? ?? ??? ??? ?? ????? ???? ????? ?? ????. ????? ????? ????? ????? ?? ????? ???? ???? ?? ???? for  ????? ?? ?? ??? ????  ???? ??? ???? ?? ??? ?? ???? ???? ?? ????? ?????  ???? ???? ??? ???? ?? ????? ?? ?? ????? ?? ???? ??? ?????? ???? ??? ?? ????? ??? ?? ????? ???? ?? ??? ?? ???????? ??? ??? ???? ?????? ???? ??????? ????? ??????? ?? ?????? ??????? ?????. ???? ?? ??? ???? ?? ???? ???????? ?? ??? ??????? ???? ?????? ???? for ???? ?? ???? ??? ??????? ??????? ???? ????? ???? ?? ????? ???? ???? ????? ?  ??? ???? ?? ??   ?????? ???? ?????? ?? ???? ?? ??????? ??????? ????? ???? ?????.

??????  3-4 ????? ???? ? ???? ? ??? ?? ???? ?? ??? ??? ?? ??? ?????? ???? ??? ????? ??? ?????? ?? ?? ???.

?????? 3-4 ???? For

class ForLoop
{
public static void Main()
{

for (int i=1; i < 10; i+2)
{
Console.Write("{0} ", i);
}

for (int i=0; i < 20; i++)
{
if (i == 10)
break;

if (i % 2 == 0)
continue;

Console.Write("{0} ", i);
}
Console.WriteLine();
}
}

?? ?????? 3-4 ????? ????? ??? ??? 0 ?? 10 ??? ?? ????. ?????? ?? ?? ???? ?????? ???? ??? ???. ?? ???? ??? ????? ????? ????? ??? ?? ?? ?? ??? ??? ??? ???? ???? ??? ? ??? ???? 2 ?? ????. ???????? ????? ??? ??????? ??? ?? ????. ??? ?? ???? ??? ????? ????? ????? ???? ??? ? ??? ???? ?? ??? ???????? ??? ??? ????? ???? ???? ???? ??????? ?????? ???? ???? ??? ???. ??? ???? ????? Break ???? ?? ??? ????? ????? ???? ??? ??? ? ????? ?? ????? ????? ????? ???? ????? ??? ? ????? Continue ???? ?? ??? ????? ???? ??????? ?? ?????? ???? ????? ???.

?????? ???? while ?? ????  for?? ??????? ?????? ????? ???? ????? ????? ???? ????? ??? ???? ??????  ????? false (?????? )?? ???? ????? ?? ????? ????? ????? ???? ???? ?????? ???? ?? ???

???? foreach

???? foreach  ???? ????? ???? ??? ????? ???? ???? ???? ??????? ???? ?? ????. ??? ????? ?? ????? ????? ?????? ?? ?? ????? ?? ????? Array List ??? ???. ??? ?????? ?? ?? ?? ?????? ?? ???? ???? System.Collections ???? ????. ???? ??? ??? ????? ????? ??? ???:

foreach (<type> <iteration variable> in <list>) { <statements> }

<type> ?????? ??? ???? ??? ????? ?? ???? ?? ???? ? ? ?? ??? ?????? ?? ??? ?? ?????? ?? ?? ???? ?????? ?? ???? ???? ?? ????. ???????? ?? ?? ???? ???? ?? ????? Foreach ????? ?? ????? ?? ??? ????? ???? ???? ?? ??? ? ??? ???? ?? ???? ???? ?? ?????? ?? ?? ????? ????? ?????.

??????? ?? ???? ??? ????? ?? ? ?? ????? ?? ????? ?? ?? ?????? ????. ?????? ????? ?? ?? ??? ??? ? ?????? ?????? ??? ????? ???? C# ?? ??? ????? ??????? ???? ???? ???.

????? ?? ???? ??? ?? ???? ?? ????? Foreach ???? ?? ????? ???? ?? ???? ???-??????? ?? ?? ???. ???? ???? ?? ?? ????? Foreach ???? ??? ????? ?? ?????? ???? ????? ??????. ?? ???? ??? ?? ?????? ???? ? ?????? (Structure) ???? ?????? ?? ? ?????? ??????? ?? ???? ?? ?????? ?????. ?????? 4-4 ?????? ??????? ?? ???? Foreach ?? ????? ?? ???.

?????? 4-4 ???? Foreach

using System;

class ForEachLoop
{
public static void Main()
{
string[] names = {"Cheryl", "Joe", "Matt", "Robert"};

foreach (string person in names)
{
Console.WriteLine("{0} ", person);
}
}
}

?? ?????? 4-4 ????? ???? ?? ????? ????? ????? ? ??????? ?? ????? ???? names ?? ???? ????? ????? ???. ??? ????? ?????? ?? ?????? ?? ???? Foreach ??????? ?????? ???. ?? ??? ???? ?? ?? ????? ???? person ?? ?? ??? String ?? ???? ?????? ????? ?????? ??????? ????? ?? ??????? ???? ?? ????? ????? names ?? ?? ?? ??????? ?????? ??????? ?? ?????? ?? ???? ????? Console.WriteLine ????? person ?? ??? ?? ???. ??? ????? ?? ????? ???? ???? Foreach ????? ??? ?? ????? ????? names ?? ????. ?? ??? ???? ??? ???? 4 ??? ????? ?????.

?????

???? ?? ?? ??? ????? ?? ???? ?? ???? ???? ?? ??????? ???? ?? ???? ???? #C ????? ????? ???? ????? ???? ?? ????? ?? ??? ?? ???? for , while , do , foreach ?? ???

???? while ?? ???? ?? ??????? ?? ??????? ?? ?? ????? true (???? ) ???? ???? ?? ??? ???? do  ????? ???? While ?? ???? ?? ??? ????? ?? ??????? ???? ???? ???? ????? ????? ???? ?????? ??. ???? ??? for  ?? ???? ?? ??????? ?? ?? ????? ????? ??? ???? ?? ???? ? foreach  ?? ?? ???? ?? ??????? ?? ???? ?? ???? ?? ?? ??????  ???? ?? ????.