C# 0 The Complete Reference


if  statement. If  i



Download 4,07 Mb.
Pdf ko'rish
bet143/1096
Sana23.01.2022
Hajmi4,07 Mb.
#402171
1   ...   139   140   141   142   143   144   145   146   ...   1096
Bog'liq
C-Sharp 3 The Complete Reference Herbert Schildt

if

 statement. If 



i

 is zero, then the outcome of the 



if

 is false. Otherwise, if 



i

 is non-


zero, then the outcome of the 

if

 is true if 



i

 is even and false if 



i

 is odd. Thus, only even, non-

zero divisors are allowed. Although this example is somewhat contrived for the sake of 

illustration, such constructs are occasionally very useful.



Spacing and Parentheses

An expression in C# can have tabs and spaces in it to make it more readable. For example, 

the following two expressions are the same, but the second is easier to read:

x=10/y*(127+x);

x = 10 / y * (127 + x);

Parentheses can be used to group subexpressions, thereby effectively increasing the 

precedence of the operations contained within them, just like in algebra. Use of redundant 

or additional parentheses will not cause errors or slow down execution of the expression. 

You are encouraged to use parentheses to make clear the exact order of evaluation, both for 

yourself and for others who may have to figure out your program later. For example, which 

of the following two expressions is easier to read?

x = y/3-34*temp+127;

x = (y/3) - (34*temp) + 127;

www.freepdf-books.com




84

 

P a r t   I :  



T h e   C #   L a n g u a g e


Download 4,07 Mb.

Do'stlaringiz bilan baham:
1   ...   139   140   141   142   143   144   145   146   ...   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