Help ! Lottery ticket program.

I need to write a program that create a lottery ticket with six random numbers for each dollar that the user input. The first 5 being from 1-50 included and the sixth number from 1-60 included.

#include <iostream>
#include <cstdlib>
#include <iomanip>
#include <ctime>
using namespace std;

int main() {
int amountOfdollars;
cout << "Enter Amount of Dollars You Wish to Spend:";
cin >> amountOfdollars;

srand(time(NULL));
const unsigned int sizeOfArray = 6;
int lotArray[sizeOfArray];
lotArray[5] = rand() % 60;
for (int i = 0; i < sizeOfArray; i++)
{
lotArray[i] = rand() % 50;
cout << lotArray[i] << endl;
}
}
I need to make the program generates a ticket with 6 digits for each dollar that the user wants to spend.
Thank you
Last edited on
Topic archived. No new replies allowed.