Hey i have started this random number generator and i am having a problem. The code produces a random integer from 0 to 4. This is good, but i was wondering how i could alter the code to get a random number from 1 to 4. Thats it
Code:
#include <iostream>
#include <stdlib.h>
#include <time.h>

int main(int argc, char *argv[])
{
  time_t now;
  time(&now);
  srand(now);
  rand();
  for (int i=0; i<1; i++) {
  cout << rand() % 5 << endl;
  }
  system("PAUSE");	
  return 0;
}