All pastes #628084 Raw Edit

Miscellany

public text v1 · immutable
·published 2007-07-20 18:42 UTC
rendered paste body
#include <stdio.h>
#include <stdlib.h>
#include <time.h>

int random_num(int);
int main() {
	int myNum=0;
	myNum = random_num(21);
	printf("%d\n",myNum);
	return 0;
}

int random_num(int MAX) {
	int random, count=0;
	srand(time(NULL));

	while(count<MAX) {
	random = 0 + (int) (rand() % MAX);
	count++;
	}

	return random;
}