   random numbers
  hiI am making a guessing game. I am struggling to get a random number. I have tried random_integer = (rand()%10)+1;cout << random_integer << endl;alwasy get 2, can someone please help me   
  You have to seed the random number generator when you first start the program. Try sticking "srand(time(0));" at the start somewhere.   ;  you need to seed the random generator, like sosrand( time(0) );it gets the current time and uses that as the initial number. the thing about random numbers produced by rand() is that they are really predicatable, you will always get the exact sma enumbers from the exact same seed. here your program used a default seed, so the first number was always 2. this is actually an aid to debugging, but not so useful when you just want some randomness   ;  Thanks i got it working   