C# 0 The Complete Reference



Download 4,07 Mb.
Pdf ko'rish
bet79/1096
Sana23.01.2022
Hajmi4,07 Mb.
#402171
1   ...   75   76   77   78   79   80   81   82   ...   1096
Bog'liq
C-Sharp 3 The Complete Reference Herbert Schildt

a

,

b

, and 

c

, by use of a comma-separated list. As mentioned earlier, 

when you need two or more variables of the same type, they can be declared in one statement. 

Just separate the variable names with commas.



The for Loop

You can repeatedly execute a sequence of code by creating a 



loop.

 C# supplies a powerful 

assortment of loop constructs. The one we will look at here is the 

for

 loop. Like the 



if

statement, the C# 



for

 loop is similar to its counterpart in C, C++, and Java. The simplest 

form of the 

for

 loop is shown here:

for(

initialization

;

 condition

;

 iteration

)

 statement

;

In its most common form, the 



initialization

 portion of the loop sets a loop control variable 

to an initial value. The 

condition

 is a Boolean expression that tests the loop control variable. If 

the outcome of that test is true, the 

for

 loop continues to iterate. If it is false, the loop terminates. 

The

iteration

expression determines how the loop control variable is changed each time the 

loop iterates. Here is a short program that illustrates the 

for

 loop:


// Demonstrate the for loop.

using System;

class ForDemo {

  static void Main() {

    int count;

www.freepdf-books.com




Download 4,07 Mb.

Do'stlaringiz bilan baham:
1   ...   75   76   77   78   79   80   81   82   ...   1096




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish