hey dingo25, well to make a random integer you have to include the rand(); command but you have to first make a random number generator which you can do by simply putting randomiize(); usually at the top of your main. Look at my code for more instructions:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
//Random # Generator Program
#include <stdlib>
#include <iostream>
#include <conio>
usingnamespace std;
int main()
{randomize(); //<--- This will initialize a random number generator based on your
// local time
int x;
x=rand()%20+1; //<--- This will display a random number from
cout<<"x="<<x; // 1-20 because rand()%x is any number from 0 to (x-1)
getch();
return 0;
}