본문 바로가기
과제/C언어

프로그래밍 실습 과제 <난수 5개 구해 출력하기>_C언어

by 잠모뺨 2022. 9. 19.

#include <stdio.h>

#include <stdlib.h>

 

int main()

{

int i, random;

 

for (i = 1; i <= 5; i++)

{

random = rand(); // 난수얻기

printf("%d번째 난수: %5d \n", i, random);

}

 

return 0;

}

 

결과 ↓

 

댓글