본문 바로가기

개발자 모드/C언어

C언어 반복문 별찍기...

728x90
#include <stdio.h>
int main(void)

{
	/*
    * 
	**
	***
	****
	*****
	*/

	for (int i = 0; i < 5; i++)

	{
		for (int j = 0; j <= i; j++)

		{

			printf("*");
		}

		printf("\n");
	}

}

 

 

결과

 

728x90

'개발자 모드 > C언어' 카테고리의 다른 글

C언어 조건문  (0) 2021.09.15
C언어 반복문 별 꺼꾸로 찍기...  (0) 2021.09.15
C언어 for 2중 반복문  (0) 2021.09.13
C언어 do while 반복문  (0) 2021.09.13
C언어 while 조건문  (0) 2021.09.13