Hi I tryed to create program I wich u can guess number, I made some if to prevent inputting 2 times the same number It works. I tryed to apply the same process for generating but it isn't working please help.
This call srand(time(NULL); should only happen once in your entire program, but I see it in several places. Try making this call just once at the beginning of main and see how your program behaves.
The time function returns a value in seconds. Unless your processor is about to melt, you program will most likely run in under a second. Thus, you are seeding the random generator to the same value over and over, meaning you will get the same random number each time.