Warning: Declaration of action_plugin_changes::register($controller) should be compatible with DokuWiki_Action_Plugin::register(Doku_Event_Handler $controller) in /volume1/web/dokuwiki/lib/plugins/changes/action.php on line 0 c_rand [Protocol Engineering Lab.]

User Tools

Site Tools


c_rand
/* rand.c: generating random numbers between 0 and 100 */
 
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
 
int main(void) {
    int i;
 
    srand(time(NULL));
 
    for(i=0; i < 10; i++) {
        printf("%d: %d\n", i, rand()%100+1);
    }
 
    return(0);
}
c_rand.txt · Last modified: 2015/02/07 04:26 by jonghyouk