Microsoft Visual C++/cli step by Step


Making decisions by using the if statement



Download 2,23 Mb.
Pdf ko'rish
bet51/102
Sana31.12.2021
Hajmi2,23 Mb.
#228061
1   ...   47   48   49   50   51   52   53   54   ...   102
Bog'liq
Visual studio C step by step

Making decisions by using the if statement

The most common way to make a decision in C++/CLI is to use the if statement. You can use the if 

statement to perform a one-way test, a two-way test, a multiway test, or a nested test. Let’s consider 

a simple one-way test first.



performing one-way tests

The following example shows how to define a one-way test in C++/CLI:

if (number < 0)  

    Console::WriteLine("The number is negative"); 

Console::WriteLine("The end");

The if keyword is followed by a conditional expression, which must be enclosed in parentheses. If 

the conditional expression evaluates to true, the next statement is executed, which in this example 

will display the message “The number is negative”. Notice that the message “The end” will always be 

displayed, regardless of the outcome of the test, because it is outside the body of the if statement.




Download 2,23 Mb.

Do'stlaringiz bilan baham:
1   ...   47   48   49   50   51   52   53   54   ...   102




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