백견불여일타 C# 입문 - 반복문

Soonyoung Kim·2021년 7월 6일
0

백견불여일타 C#

목록 보기
6/10

Point - #반복문 #for #while #do_while #break #continue

for(초기값 선언; 반복이 되는 조건; 반복문 실행 후 수행)
{
	명령수행;
}
  • 증감연산자의 흐름
public void Run()
        {
            int number = 10;

            Console.WriteLine(number++); // 10, 후증가
            Console.WriteLine(number);   // 11
            Console.WriteLine(++number); // 12, 선증가
        }
  • while
while(~하는 동안)
{
	...반복하라...
}
  • do-while
do 
{
	...반복하라...
}while(~하는 동안)
  • while과 do-while 차이
    • while : 0번 이상의 반복문/ 선조건 후 실행
    • do-while : 1번 이상의 반복문 / 선 실행 후 조건
profile
Sin prisa, sin pausa.

0개의 댓글