Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<stdlib.h>
- #include<time.h>
- void main()
- {
- int num, x,z=4;
- printf("Guess number between 0 and %d: ",z);
- scanf("%d",&num);
- srand(time(0));
- x = rand()%(z+1);
- if (num==x)
- printf ("Right!\n\n",num);
- else
- printf("Wrong!\n\n");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement