Step 1:
Include <cstdlib> & <ctime> if you are using a new compiler, if not <stdlib.h> & <time.h>
Step 2:
At the beginning of main () add srand(time(0));
Step 3:
Create a variable (in the example, Examp) to hold the number.
Step 4:
Set the value of the variable as: Examp = Minimum + rand()% ( Maximum - Minimum )
where Maximum and Minimum are the ranges for your random number.