Hey, my dad was checking the "lotto" results so that inspired me to make a little program of my own, i accomplished that just got a problem..
#include <iostream>
using namespace std;
int main()
{
srand(time(NULL));
unsigned int lotteryBall;
for(int i = 0; i <=7; ++i)
{
lotteryBall = rand() % 48 + 1;
cout << lotteryBall << " ";
if(i == 7)
cout << "*" << lotteryBall << "*";
}
cin.get();
return 0;
}
I compiled and ran the code and got : 13 19 20 9 31 12 37 46 *46*
But obviously you can't have 46 twice, so I'm not sure how I could change it.
And before you say "the numbers need to go in order from smallest to largest" I will add bubble sort after I have got the main problem solved.
Many thanks.