
	/* this program tests its single numerical argument to see if it is 
	   greater than a randomly-generated number in the range of zero to one.
	   If the argument is  >=  the number, it returns zero (0).
	   If the argument is  <   the number, it returns one  (1).
	   If there is no argument, the program prints a message to stderr
	   and exits with code -1. */

#include <stdio.h>

char *progname = "probok";

#define RAND_MAX      32768

main(argc, argv)
int argc;
char *argv[];
{
	long t;
	double num;

	if ((argc != 2) || (sscanf(argv[1], "%lf", &num) != 1)) {
		fprintf(stderr, "usage: probunder number\n");
		exit(-1);
	}
	t = time((long *) 0);
	srand((unsigned int) t);
	if (num >= (rand()/(double)RAND_MAX))
		exit(0);
	else
		exit(1);
}
