Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <time.h>
- #include <stdlib.h>
- #include <stdio.h>
- int main()
- {
- int myNum, yourNum, count = 0;
- srand(time(NULL));
- myNum = rand() % 6;
- do
- {
- count++;
- scanf("%d",&yourNum);
- if (yourNum == myNum)
- {
- printf("%d\nA:%d\n",myNum,count);
- yourNum = -1;
- }
- if (yourNum > myNum)
- printf(">\n");
- else if ((yourNum < myNum) && (yourNum != -1))
- printf("<\n");
- } while (yourNum != -1);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement