File: keys.c

package info (click to toggle)
python-sysv-ipc 1.1.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 540 kB
  • sloc: ansic: 3,140; python: 1,960; makefile: 8; sh: 4
file content (19 lines) | stat: -rw-r--r-- 338 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include <stdlib.h>
#include <stdio.h> 
#include <limits.h>

int main() { 
    int i;
    int key;
    

    for (i = 0; i < 10000000; i++) {
        // ref: http://www.c-faq.com/lib/randrange.html
        key = ((int)((double)rand() / ((double)RAND_MAX + 1) * INT_MAX)) + 1;
        printf("%d\n", key);
    }
    
 
    
    return 1;
}