Microsoft Visual C++/cli step by Step



Download 2,23 Mb.
Pdf ko'rish
bet66/102
Sana31.12.2021
Hajmi2,23 Mb.
#228061
1   ...   62   63   64   65   66   67   68   69   ...   102
Bog'liq
Visual studio C step by step

 

CHAPTER 5

 

Decision and loop statements 



 69

int count = 1; 

while (count <= 5) 

    Console::WriteLine(count * count); 



    count++; 

Console::WriteLine("The end");



You must follow the while keyword with a conditional expression enclosed in parentheses. As long 

as the conditional expression evaluates to true, the while body executes. After the loop body has been 

executed, control returns to the while statement and the conditional expression is tested again. This 

sequence continues until the test evaluates to false.

You must, of course, remember to include some kind of update statement in the loop so that it will 

terminate eventually. In this example count++ is incrementing the loop counter. If you don’t provide 

an update statement, the loop will iterate forever, which probably isn’t what you want.

The preceding example displays the following output:

In this exercise, you will enhance your Calendar Assistant application so that the user can type five 

dates.



Download 2,23 Mb.

Do'stlaringiz bilan baham:
1   ...   62   63   64   65   66   67   68   69   ...   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