Lottery C++

int main()
{
int WN[5];
int UI[5];
int MN = 0;

srand(time(NULL));
WN[0] = (rand() % 10);
WN[1] = (rand() % 10);
WN[2] = (rand() % 10);
WN[3] = (rand() % 10);
WN[4] = (rand() % 10);

cout << "LOTTO Winning Numbers: " << WN[0] << WN[1] << WN[2] << WN[3] << WN[4] << endl;
cout << "USER Numbers: " << endl;
for (int i = 0; i < 5; i++)
{
cout << "Enter a digit between 0 and 9: ";
cin >> UI[i];
while (UI[i]<0 || UI[i]>9)
{
cout << "Error! Entry must be between 0 and 9: ";
cin >> UI[i];
}
}
cout << "Matching Numbers: ";
for (int i = 0; i<5; i++)
{
for (int j = 0; j<5; j++)
{
if (WN[i] == UI[j])
cout << WN[i];
{
MN++;
}
}
}



if (MN = 5)
cout << endl << "Prize: P500,000. Congratulations! You one lucky son of a God!" << endl;
else if (MN = 4)
cout << endl << "Prize: P100,000. Congratulations! The odds is in your favor!" << endl;
else if (MN = 3)
cout << endl << "Prize: P20,000. Congratulations! You can now buy an expensive item of your choice!" << endl;
else if (MN = 2)
cout << endl << "Prize: P500. Yay! Added allowance!" << endl;
else if (MN = 1)
cout << endl << "Prize: P10. Balik taya!" << endl;
else if (MN = 0)
cout << endl << "Zero Matching Digits. Try Again.";


system("pause>0");
return 0;
}

I fixed it but the only problem is the prize...
OUTPUT:
OUTPUT PROGRAM:
LOTTO Winning Numbers: 17409
Enter 1st number: 1
Enter 2nd number: 3
Enter 3rd number: 4
Enter 4th number: 6
Enter 5th number: 7
Matching Number: 174
Prize: Prize: P500,000. Congratulations! You one lucky son of a God!
//5 matching digits- 500,000 pesos
4 matching digits-100,000 pesos
3 matching digits- 20,000 pesos
2 matching digits- 500 pesos
1 matching digits-10 pesos or Balik taya! ~(>3>)~
0 matching digits-Try Again!~(^3>)~
Please do not repost the same code you just posted in another thread. Particularly when that thread is already at the top of forum list. It's very inconsiderate, and some would go so far as to characterize it as rude (especially when the problem as already been addressed in said thread.)

Replies to: http://www.cplusplus.com/forum/general/143895/
Topic archived. No new replies allowed.