#include <stdio.h>
#include <stdlib.h>
#include <time.h>
 
int main()
{
    // Random değer üretmek için srand() tohum değerinin time(NULL) olması gerekir. Bu değer özel olarak girilirse aynı sıra ile random değer verebilir bu durum genelde Oyunlar Random World Generation olarak kullanılır.
    srand(time(NULL));

    // 0 ile 50 arasında random bir değer oluşturur.
    printf("%d\n", rand() % 50);
 
    return 0;
}
Categories: C language

5 Comments

จองตั๋วรถตู้ · 28/02/2025 at 00:54

… [Trackback]

[…] Here you will find 13719 more Info on that Topic: durukanbal.com/2021/01/17/c-srand-rand-function-sample/ […]

Slot-online999 · 05/03/2025 at 10:06

… [Trackback]

[…] Info to that Topic: durukanbal.com/2021/01/17/c-srand-rand-function-sample/ […]

ปวดประจำเดือน · 15/03/2025 at 16:16

… [Trackback]

[…] Read More on that Topic: durukanbal.com/2021/01/17/c-srand-rand-function-sample/ […]

Aviator · 24/03/2025 at 19:54

… [Trackback]

[…] Find More Information here on that Topic: durukanbal.com/2021/01/17/c-srand-rand-function-sample/ […]

1xbet · 25/03/2025 at 18:32

… [Trackback]

[…] Read More here on that Topic: durukanbal.com/2021/01/17/c-srand-rand-function-sample/ […]

Leave a Reply

Avatar placeholder