Number Catching Game| C Languange|Busy

View this thread on: d.buzz | hive.blog | peakd.com | ecency.com
·@countblackbeard·
0.000 HBD
Number Catching Game| C Languange|Busy
Basic game for c learners


 #include <stdio.h>
 #include <stdlib.h>
 #include <time.h>

 int main (void)
{
	 
	int playerNum, n,randNum,looop=1,loop=1,sum=0;
	srand(time(NULL));
	
	
	
		
	randNum=rand()%1000;
	printf("Please enter a number for start:");

	
	do{
	scanf("%d",&playerNum);
	sum++;
		
	if(playerNum==randNum)
	{
	printf("Congrt, you find it %d",sum);
	
	loop=0;
	}
	else if(playerNum>randNum)
	{
		printf("Make smaller");
	}
	else
	{
		printf("Make higher");
	}
}while(loop==1);



	return 0;
}
👍 , , , , , , , , , , , , , , , , , , , , , , , , , , ,