lookjapan.COM - IRC ve mIRC dünyasının forumu!

lookjapan.COM - IRC ve mIRC dünyasının forumu! (http://www.lookjapan.com/index.php)
-   C ve C++ (http://www.lookjapan.com/forumdisplay.php?f=148)
-   -   Belirtilen rakam kadar random sayi üreten program (http://www.lookjapan.com/showthread.php?t=4083)

Entrance 25 Eylül 2016 21:34

Belirtilen rakam kadar random sayi üreten program
 
Programa girilen rakam kadar size random sayı(lar) üretir. Ardından yazdığınız rakamı programın sonunda bildirir. Kullanılan programlama dili C'dir.

Kod:

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

/* by Entrance */

int main()
{
        srand(time(NULL));
        int rast;
       
        printf("Kac adet random sayi uretilsin?");
        scanf("%d", &rast);
       
        for(int i = 0; i < rast; i++)
        {
                printf("%d\n", rand());
        }
        printf("Toplam %d adet random sayi uretildi..", rast);
       
        return 0;
}

İyi forumlar. ^^


All times are GMT +3. The time now is 13:52.

Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.