#include <stdio.h>
#include <stdlib.h>
#include <time.h>

int main() {
    srand(time(NULL)); //난수 초기화
    printf("%d\n", rand() % 5); //0~4
    printf("%d\n", rand() % 5+1); //1~5
    printf("%d\n", rand() % 5-1); //-1~3
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: