mercredi 6 janvier 2016

How to generate a random 8 digit number in c

It prints something like this 1111354xx every time i run it. The code:

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

    int main() {

        srand(time(NULL));
        unsigned long long int code;

        tkodikos=rand()%88888889+10000000; 

        printf("%llu",code);

        return 0;
    }




Aucun commentaire:

Enregistrer un commentaire