There are 2 approaches to this.....
1) read the damn frequently asked questions....
2) the functions you need are srand() to seed the random number generator and rand() to give you a random number between 0 and RAND_MAX.You will find these functions in <cstdlib> or <stdlib.h>
using namespace std;
// seed the random num gen. with system time for unique randomness
// now a loop
//get a random number between 1 and 100.
//we use modulus to get a number in the desired range.
//+1 because %100 returns 0-99
int randomnum=rand() %100 +1;