All pastes #29544 Raw Edit

Miscellany

public text v1 · immutable
#29544 ·published 2005-11-20 10:41 UTC
rendered paste body
#include <stdio.h>
#include <stdlib.h>
#include <time.h>

main()
{
	int guess, gen;

	srand(time(NULL));  /*used the time as in the machine to generate the random number*/
	gen = rand()%12;     /*the gen are being used as the number needed to be guest*/
	printf("%d\n", gen);

		while (gen != guess){
			printf ("Please guess a number between 0 -12: \n");
			scanf("%d",&guess);
			/*printf("%d",gen); /*for troubleshoot to see what is the number the machine has pick up*/
		if (gen > guess)
			printf("The number you enter are too small\n");
				else if (gen < guess )
					printf("The number you enter are too big\n");
						else
							printf("Congratualtion, you have guess the correct number\n");
	}
return 0;
}