๐ ๊ณต๋ถํ๋ ์ง์ง์ํ์นด๋ ์ฒ์์ด์ง?
[inflearn ๊ฐ์] ๊ธฐ๋ณธ ๋ฌธ๋ฒ - do while ๋ณธ๋ฌธ
๐ฉ๐ป IoT (Embedded)/C++
[inflearn ๊ฐ์] ๊ธฐ๋ณธ ๋ฌธ๋ฒ - do while
์ง์ง์ํ์นด 2023. 6. 29. 00:55728x90
๋ฐ์ํ
<๋ณธ ๋ธ๋ก๊ทธ๋ ์ด์ํธ๋ฝ ๊ฒ์์์นด๋ฐ๋ฏธ ๋์ ์ ํ๋ธ๋ฅผ ์ฐธ๊ณ ํด์ ๊ณต๋ถํ๋ฉฐ ์์ฑํ์์ต๋๋ค :-)>
=> C++ Let's Make Games
๐ซง do while
do {} while(์กฐ๊ฑด์)
while ์ ์ฒ์ ์ง์
์ ์กฐ๊ฑด์์ ์ฒดํฌํ์ง๋ง
do while ์ ์ฒ์ ํ๋ฒ์ ๋ฌด์กฐ๊ฑด ๋์์ด ๋๊ณ , ๊ทธ ํ์๋ ์กฐ๊ฑด์์ ์ฒดํฌํด์ true ๊ฒฝ์ฐ ๋์
// Chapter1_10
#include <iostream>
using namespace std;
int main()
{
/*
do while : ๋ฐ๋ณต๋ฌธ์ ์ข
๋ฅ
do {} while(์กฐ๊ฑด์)
while ์ ์ฒ์ ์ง์
์ ์กฐ๊ฑด์์ ์ฒดํฌํ์ง๋ง
do while ์ ์ฒ์ ํ๋ฒ์ ๋ฌด์กฐ๊ฑด ๋์์ด ๋๊ณ , ๊ทธ ํ์๋ ์กฐ๊ฑด์์ ์ฒดํฌํด์ true ๊ฒฝ์ฐ ๋์
*/
int iNumber = 0;
do {
cout << iNumber << endl;
} while (iNumber > 0);
return 0;
}
728x90
๋ฐ์ํ
'๐ฉโ๐ป IoT (Embedded) > C++' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[inflearn ๊ฐ์] ๊ธฐ๋ณธ ๋ฌธ๋ฒ - ๋ก๋ ๋ง๋ค๊ธฐ (0) | 2023.06.29 |
---|---|
[inflearn ๊ฐ์] ๊ธฐ๋ณธ ๋ฌธ๋ฒ - ๋ฐฐ์ด (0) | 2023.06.29 |
[inflearn ๊ฐ์] ๊ธฐ๋ณธ ๋ฌธ๋ฒ - ์์ ๋ฌธ์ (๋ค์ํ๊ฒ ๋ณ ์ฐ๊ธฐ, ๊ตฌ๊ตฌ๋จ) (0) | 2023.06.29 |
[inflearn ๊ฐ์] ๊ธฐ๋ณธ ๋ฌธ๋ฒ - for๋ฌธ๊ณผ ์ค์ฒฉfor๋ฌธ (0) | 2023.06.27 |
[inflearn ๊ฐ์] ๊ธฐ๋ณธ ๋ฌธ๋ฒ - switch๋ฌธ๊ณผ ์ด๊ฑฐ์ฒด (0) | 2023.06.27 |
Comments